From d303f2be79d86ba422c9c54c6a37d9af3db890cd Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Tue, 28 Feb 2023 16:35:36 +0100 Subject: [PATCH] Add /running endpoint --- GlosSITarget/CommonHttpEndpoints.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GlosSITarget/CommonHttpEndpoints.h b/GlosSITarget/CommonHttpEndpoints.h index 98c7098..8c74834 100644 --- a/GlosSITarget/CommonHttpEndpoints.h +++ b/GlosSITarget/CommonHttpEndpoints.h @@ -8,6 +8,14 @@ namespace CHTE { inline void addEndpoints() { + HttpServer::AddEndpoint( + {"/running", + HttpServer::Method::GET, + [](const httplib::Request& req, httplib::Response& res) { + // TODO: extend this when "passive" running of global mods is implemented + res.set_content(nlohmann::json{{"state", nlohmann::json{{"running", true}}}}.dump(), "text/json"); + }}); + HttpServer::AddEndpoint( {"/settings", HttpServer::Method::GET,