mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-04-22 18:29:00 +02:00
feat: add health check endpoint to server (#2968)
This commit is contained in:
parent
f92bd59951
commit
88d13a17a7
@ -1024,6 +1024,11 @@ int main(int argc, char ** argv) {
|
|||||||
// check if the model is in the file system
|
// check if the model is in the file system
|
||||||
});
|
});
|
||||||
|
|
||||||
|
svr.Get(sparams.request_path + "/health", [&](const Request &, Response &res){
|
||||||
|
const std::string health_response = "{\"status\":\"ok\"}";
|
||||||
|
res.set_content(health_response, "application/json");
|
||||||
|
});
|
||||||
|
|
||||||
svr.set_exception_handler([](const Request &, Response &res, std::exception_ptr ep) {
|
svr.set_exception_handler([](const Request &, Response &res, std::exception_ptr ep) {
|
||||||
const char fmt[] = "500 Internal Server Error\n%s";
|
const char fmt[] = "500 Internal Server Error\n%s";
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
Loading…
Reference in New Issue
Block a user