#include "TestController.h" using namespace example; void TestController::asyncHandleHttpRequest( const HttpRequestPtr &req, std::function &&callback) { // write your application logic here LOG_WARN << req->matchedPathPatternData(); LOG_DEBUG << "index=" << threadIndex_.getThreadData(); ++(threadIndex_.getThreadData()); auto resp = HttpResponse::newHttpResponse(); resp->setContentTypeCodeAndCustomString(CT_TEXT_PLAIN, "Content-Type: plaintext\r\n"); resp->setBody("

Hello, world!

"); resp->setExpiredTime(20); callback(resp); }