Skip to content

Commit df1b612

Browse files
authored
server : add /v1/health endpoint (#16461)
* server : add /v1/health endpoint * cont : update readme
1 parent 4e0388a commit df1b612

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tools/server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ node index.js
393393

394394
### GET `/health`: Returns health check result
395395

396-
This endpoint is public (no API key check).
396+
This endpoint is public (no API key check). `/v1/health` also works.
397397

398398
**Response format**
399399

tools/server/server.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4184,6 +4184,7 @@ int main(int argc, char ** argv) {
41844184
auto middleware_validate_api_key = [&params, &res_error](const httplib::Request & req, httplib::Response & res) {
41854185
static const std::unordered_set<std::string> public_endpoints = {
41864186
"/health",
4187+
"/v1/health",
41874188
"/models",
41884189
"/v1/models",
41894190
"/api/tags"
@@ -5232,6 +5233,7 @@ int main(int argc, char ** argv) {
52325233

52335234
// register API routes
52345235
svr->Get (params.api_prefix + "/health", handle_health); // public endpoint (no API key check)
5236+
svr->Get (params.api_prefix + "/v1/health", handle_health); // public endpoint (no API key check)
52355237
svr->Get (params.api_prefix + "/metrics", handle_metrics);
52365238
svr->Get (params.api_prefix + "/props", handle_props);
52375239
svr->Post(params.api_prefix + "/props", handle_props_change);

0 commit comments

Comments
 (0)