From d514ea5aab095714c3f37b13607789a61bc88e9e Mon Sep 17 00:00:00 2001 From: Tiago Garcia Date: Thu, 18 Jul 2024 19:12:37 +0100 Subject: [PATCH] Add route "/" for ping Signed-off-by: Tiago Garcia --- src/routes.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/routes.cpp b/src/routes.cpp index e08aad4..d09bac2 100644 --- a/src/routes.cpp +++ b/src/routes.cpp @@ -8,6 +8,17 @@ Routes::Routes(nlohmann::json config) { const nlohmann::json config_run_scripts = config["run-scripts"]; const nlohmann::json config_tokens = config["tokens"]; + CROW_ROUTE(this->app, "/") + .methods("POST"_method) + .name("Ping") + ([]() { + nlohmann::json response = { + {"status", 200}, + {"message", "Pong"} + }; + return crow::response(200, response.dump()); + }); + CROW_ROUTE(this->app, "/update-files") .methods("POST"_method) .name("Update Files")