From 3ead75baaef47b9a3e4107a1b63fbbf10fc3ed2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD?= Date: Thu, 21 Mar 2024 07:20:29 +0300 Subject: [PATCH] add second route --- main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 2763747..48142f7 100644 --- a/main.cpp +++ b/main.cpp @@ -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(),