рефактор + чистка кода

This commit is contained in:
2024-10-30 10:40:38 +03:00
parent 2fef65d9d9
commit 5c348ace87
16 changed files with 47 additions and 130 deletions

View File

@@ -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));
}));