C++ HttpServer Example: Creating a Simple 'Hello, World!' Endpoint
// Example handler that returns 'Hello, World!' for any request http_server->AddHandler("/", [](const HttpRequest& req) { HttpResponse res; res.SetStatus(200); res.SetBody('Hello, World!'); return res; });
// Start the server http_server->Start();
原文地址: https://www.cveoy.top/t/topic/niru 著作权归作者所有。请勿转载和采集!