drogon/examples/simple_example/TestController.cc

9 lines
338 B
C++
Executable File

#include "TestController.h"
using namespace example;
void TestController::asyncHandleHttpRequest(const HttpRequestPtr& req,const std::function<void (const HttpResponsePtr &)>&callback)
{
//write your application logic here
auto resp=HttpResponse::newHttpResponse();
resp->setBody("<p>Hello, world!</p>");
callback(resp);
}