add second route
This commit is contained in:
parent
dd8721e96a
commit
3ead75baae
8
main.cpp
8
main.cpp
@ -54,8 +54,14 @@ StringResponse HandleRequest(StringRequest&& req)
|
|||||||
}
|
}
|
||||||
|
|
||||||
string_view config_ref {config.begin(), config.end()};
|
string_view config_ref {config.begin(), config.end()};
|
||||||
|
|
||||||
auto parsed_config = json::parse(config_ref);
|
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(),
|
else if (equal(k_MapsPattern.begin(),
|
||||||
k_MapsPattern.end(),
|
k_MapsPattern.end(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user