drogon/examples/simple_example/TestController.cc

10 lines
370 B
C++
Raw Normal View History

2018-05-14 08:57:40 +00:00
#include "TestController.h"
using namespace example;
2018-10-14 07:56:54 +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
2018-10-14 07:56:54 +00:00
auto resp = HttpResponse::newHttpResponse();
2018-09-11 10:40:00 +00:00
resp->setBody("<p>Hello, world!</p>");
2018-10-11 03:20:40 +00:00
resp->setExpiredTime(0);
2018-08-26 08:25:35 +00:00
callback(resp);
2018-05-14 08:57:40 +00:00
}