File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include " health.h"
2
+
3
+ void health::asyncHandleHttpRequest (
4
+ const HttpRequestPtr &req,
5
+ std::function<void (const HttpResponsePtr &)> &&callback) {
6
+ auto resp = HttpResponse::newHttpResponse ();
7
+ resp->setStatusCode (k200OK);
8
+ resp->setContentTypeCode (CT_TEXT_HTML);
9
+ resp->setBody (" Nitro is alive!!!" );
10
+ callback (resp);
11
+ }
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include < drogon/HttpSimpleController.h>
4
+ #include < drogon/HttpTypes.h>
5
+
6
+ using namespace drogon ;
7
+
8
+ class health : public drogon ::HttpSimpleController<health>
9
+ {
10
+ public:
11
+ void asyncHandleHttpRequest (const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback) override ;
12
+ PATH_LIST_BEGIN
13
+ PATH_ADD (" /healthz" , Get);
14
+ PATH_LIST_END
15
+ };
You can’t perform that action at this time.
0 commit comments