drogon/examples/benchmark/BenchmarkCtrl.cc

12 lines
349 B
C++
Raw Normal View History

#include "BenchmarkCtrl.h"
2019-05-18 12:39:57 +00:00
void BenchmarkCtrl::asyncHandleHttpRequest(
const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&callback)
{
2019-05-18 12:39:57 +00:00
// write your application logic here
auto resp = HttpResponse::newHttpResponse();
resp->setBody("<p>Hello, world!</p>");
resp->setExpiredTime(0);
callback(resp);
2019-12-23 06:08:56 +00:00
}