mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 15:05:31 +08:00
simple dedicated health check endpoint for docker
This commit is contained in:
parent
e21a1b56fa
commit
9827e30a61
2 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue