drogon/examples/simple_example/TestController.cc

12 lines
447 B
C++
Raw Normal View History

2018-05-14 08:57:40 +00:00
#include "TestController.h"
using namespace example;
2018-08-26 08:25:35 +00:00
void TestController::asyncHandleHttpRequest(const HttpRequestPtr& req,const std::function<void (const HttpResponsePtr &)>&callback)
2018-05-14 08:57:40 +00:00
{
//write your application logic here
auto resp=HttpResponse::newHttpResponse();
2018-05-14 08:57:40 +00:00
LOG_DEBUG<<"!!!!!!!!!!1";
2018-09-06 11:06:25 +00:00
resp->setStatusCode(HttpResponse::k200OK);
2018-05-14 08:57:40 +00:00
resp->setContentTypeCode(CT_TEXT_HTML);
resp->setBody("hello!!!");
2018-08-26 08:25:35 +00:00
callback(resp);
2018-05-14 08:57:40 +00:00
}