mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-02 19:57:43 +08:00
14 lines
419 B
C++
14 lines
419 B
C++
#include "TestController.h"
|
|
using namespace example;
|
|
void TestController::asyncHandleHttpRequest(
|
|
const HttpRequestPtr &req,
|
|
std::function<void(const HttpResponsePtr &)> &&callback)
|
|
{
|
|
// write your application logic here
|
|
LOG_WARN << req->matchedPathPattern();
|
|
auto resp = HttpResponse::newHttpResponse();
|
|
resp->setBody("<p>Hello, world!</p>");
|
|
resp->setExpiredTime(0);
|
|
callback(resp);
|
|
}
|