simple dedicated health check endpoint for docker

This commit is contained in:
zadam 2022-06-19 14:15:31 +02:00
parent e21a1b56fa
commit 9827e30a61
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,5 @@
#!/bin/sh
if wget --spider -S "127.0.0.1:8080/login" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then
if wget --spider -S "127.0.0.1:8080/api/health-check" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then
exit 0
else
exit 1

View file

@ -318,6 +318,9 @@ function register(app) {
apiRoute(POST, '/api/recent-notes', recentNotesRoute.addRecentNote);
apiRoute(GET, '/api/app-info', appInfoRoute.getAppInfo);
// docker health check
route(GET, '/api/health-check', [], () => ({"status": "ok"}), apiResultHandler);
// group of services below are meant to be executed from outside
route(GET, '/api/setup/status', [], setupApiRoute.getStatus, apiResultHandler);
route(POST, '/api/setup/new-document', [auth.checkAppNotInitialized], setupApiRoute.setupNewDocument, apiResultHandler, false);