drogon/examples/simple_example/TestController.cc

12 lines
439 B
C++
Raw Normal View History

2018-05-14 08:57:40 +00:00
#include "TestController.h"
using namespace example;
2018-08-02 07:38:06 +00:00
void TestController::asyncHandleHttpRequest(const HttpRequestPtr& req,const std::function<void (HttpResponse &)>&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";
resp->setStatusCode(HttpResponse::k200Ok);
resp->setContentTypeCode(CT_TEXT_HTML);
resp->setBody("hello!!!");
callback(*resp);
}