рефактор + чистка кода
This commit is contained in:
@@ -77,12 +77,12 @@ static void initResources(http::server::Server& s) {
|
||||
|
||||
s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/api/statistics", [](const auto& req, auto& rep) {
|
||||
if (req.method != "GET") {
|
||||
http::server::stock_reply(http::server::bad_request, rep);
|
||||
http::server::stockReply(http::server::bad_request, rep);
|
||||
}
|
||||
|
||||
rep.status = http::server::ok;
|
||||
rep.headers.clear();
|
||||
rep.headers.push_back({.name = "Content-Type", .value = to_string(mime_types::json)});
|
||||
rep.headers.push_back({.name = "Content-Type", .value = toString(mime_types::json)});
|
||||
const char* json = R"({"key":"value"})";
|
||||
rep.content.insert(rep.content.end(), json, json + strlen(json));
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user