2018-05-14 16:57:40 +08:00
|
|
|
#include "TestController.h"
|
2018-05-29 13:49:26 +08:00
|
|
|
using namespace example;
|
2019-05-18 20:39:57 +08:00
|
|
|
void TestController::asyncHandleHttpRequest(
|
|
|
|
const HttpRequestPtr &req,
|
|
|
|
std::function<void(const HttpResponsePtr &)> &&callback)
|
2018-05-14 16:57:40 +08:00
|
|
|
{
|
2019-05-18 20:39:57 +08:00
|
|
|
// write your application logic here
|
2019-03-18 10:30:20 +08:00
|
|
|
LOG_WARN << req->matchedPathPattern();
|
2018-10-14 15:56:54 +08:00
|
|
|
auto resp = HttpResponse::newHttpResponse();
|
2018-09-11 18:40:00 +08:00
|
|
|
resp->setBody("<p>Hello, world!</p>");
|
2018-10-11 11:20:40 +08:00
|
|
|
resp->setExpiredTime(0);
|
2018-08-26 16:25:35 +08:00
|
|
|
callback(resp);
|
2018-11-16 13:26:14 +08:00
|
|
|
}
|