drogon/examples/static_link_example/TestViewCtl.cc

9 lines
352 B
C++
Executable File

#include "TestViewCtl.h"
void TestViewCtl::asyncHandleHttpRequest(const HttpRequest& req,std::function<void (HttpResponse &)>callback)
{
//write your application logic here
drogon::HttpViewData data;
data.insert("title",std::string("TestView"));
auto res=drogon::HttpResponse::newHttpViewResponse("TestView",data);
callback(*res);
}