OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
HealthCheckController.cpp
Go to the documentation of this file.
2
3using namespace Odb::Lib::App;
4
5namespace Odb::App::Server
6{
11
13 {
14 //register_route_handler("/health_check", std::bind(&HealthCheckController::health_check, this, std::placeholders::_1));
15
16 //register_route_handler("/health_check", [&](const crow::request& req) /*-> crow::response*/
17 // {
18 // return crow::response(crow::status::OK, "healthy");
19 // }
20 //);
21
22 register_route_handler("/healthz/live", std::bind(&HealthCheckController::health_check_live, this, std::placeholders::_1));
23 register_route_handler("/healthz/ready", std::bind(&HealthCheckController::health_check_ready, this, std::placeholders::_1));
24 register_route_handler("/healthz/started", std::bind(&HealthCheckController::health_check_started, this, std::placeholders::_1));
25 }
26
27 crow::response HealthCheckController::health_check_live(const crow::request& req)
28 {
29 return crow::response(crow::status::OK, "txt", "healthy: live");
30 }
31
32 crow::response HealthCheckController::health_check_ready(const crow::request& req)
33 {
34 return crow::response(crow::status::OK, "txt", "healthy: ready");
35 }
36
37 crow::response HealthCheckController::health_check_started(const crow::request& req)
38 {
39 return crow::response(crow::status::OK, "txt", "healthy: started");
40 }
41}
HealthCheckController(Odb::Lib::App::IOdbServerApp &serverApp)
void register_route_handler(std::string route, TRouteHandlerFunction handler)