From 24f05d89b4c6dd1f80c715d01af61a7909e5c0fc Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Thu, 6 Oct 2022 15:08:08 +0530 Subject: [PATCH] `/config` API to get active config details --- tinyphone/server.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tinyphone/server.cpp b/tinyphone/server.cpp index d58705e..5db38c7 100644 --- a/tinyphone/server.cpp +++ b/tinyphone/server.cpp @@ -83,6 +83,19 @@ void TinyPhoneHttpServer::Start() { }; return tp::response(200, response); }); + + + CROW_ROUTE(app, "/config")([]() { + std::string productVersion; + GetProductVersion(productVersion); + json response = { + { "version", productVersion }, + { "config", tp::ApplicationConfig}, + { "sip-log-file", tp::sipLogFile}, + { "http-log-file", tp::httpLogFile}, + }; + return tp::response(200, response); + }); std::unordered_set subscribers;