-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Healthcheck endpoint #1751
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1751 +/- ##
===========================================
- Coverage 71.71% 71.71% -0.01%
===========================================
Files 292 295 +3
Lines 12487 12652 +165
Branches 6359 6473 +114
===========================================
+ Hits 8955 9073 +118
- Misses 1848 1871 +23
- Partials 1684 1708 +24 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
@@ -49,10 +48,8 @@ resolve(std::string const& ip, std::string const& port) | |||
{ | |||
web::Resolver resolver; | |||
|
|||
if (auto const results = resolver.resolve(ip, port); not results.empty()) { | |||
std::cout << "resolved ip: '" << results.at(0) << '\n'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😨
@@ -178,6 +186,16 @@ ClioApplication::run(bool const useNgWebServer) | |||
} | |||
); | |||
|
|||
httpServer->onGet( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a nuisance when merging back into release/2.3.0
@@ -178,6 +186,16 @@ ClioApplication::run(bool const useNgWebServer) | |||
} | |||
); | |||
|
|||
httpServer->onGet( | |||
"/health", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe /ping
? Or /healthcheck
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe /ping will be confusing. Because we have ping API
@@ -58,7 +59,7 @@ using tcp = boost::asio::ip::tcp; | |||
|
|||
namespace { | |||
|
|||
std::string | |||
std::pair<boost::beast::http::status, std::string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a structure would be better?
This implement a simple endpoint for system healthcheck.