add second route

This commit is contained in:
Антон 2024-03-21 07:20:29 +03:00
parent dd8721e96a
commit 3ead75baae
1 changed files with 7 additions and 1 deletions

View File

@ -54,8 +54,14 @@ StringResponse HandleRequest(StringRequest&& req)
}
string_view config_ref {config.begin(), config.end()};
auto parsed_config = json::parse(config_ref);
StringResponse res(http::status::ok, 1);
res.set(http::field::content_type, content_type::k_JSON);
res.body() = json::serialize(parsed_config.as_object().at("maps"sv).as_array());
res.content_length(res.body().size());
res.keep_alive(true);
return res;
}
else if (equal(k_MapsPattern.begin(),
k_MapsPattern.end(),