2018-05-14 08:57:40 +00:00
|
|
|
#include "TestController.h"
|
2018-05-29 05:49:26 +00:00
|
|
|
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
|
|
|
{
|
2018-05-29 05:49:26 +00:00
|
|
|
//write your application logic here
|
2018-05-30 13:23:46 +00:00
|
|
|
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);
|
|
|
|
}
|