Add route "/" for ping

Signed-off-by: Tiago Garcia <tiago.rgarcia@ua.pt>
This commit is contained in:
Tiago Garcia 2024-07-18 19:12:37 +01:00
parent 2409ec8f5a
commit d514ea5aab
Signed by: TiagoRG
GPG Key ID: DFCD48E3F420DB42
1 changed files with 11 additions and 0 deletions

View File

@ -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")