mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-22 15:33:28 -07:00
Add /healthz endpoint
There is still work to be done here. Ideally, this endpoint should return information about the document store health, and return a more informative 200 instead of an empty 204. Fixes #383
This commit is contained in:
parent
7286385833
commit
4c0bc186ae
2 changed files with 6 additions and 1 deletions
|
@ -61,7 +61,7 @@ ENTRYPOINT [ "bash", "docker-entrypoint.sh" ]
|
|||
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s \
|
||||
--retries=3 CMD [ "sh", "-c", "echo -n 'curl localhost:7777... '; \
|
||||
(\
|
||||
curl -sf localhost:7777 > /dev/null\
|
||||
curl -sf localhost:7777/healthz > /dev/null\
|
||||
) && echo OK || (\
|
||||
echo Fail && exit 2\
|
||||
)"]
|
||||
|
|
|
@ -109,6 +109,11 @@ if (config.rateLimits) {
|
|||
|
||||
// first look at API calls
|
||||
app.use(route(function(router) {
|
||||
// get healthz
|
||||
router.get("/healthz", function (request, response) {
|
||||
response.writeHead(204);
|
||||
response.end();
|
||||
});
|
||||
// get raw documents - support getting with extension
|
||||
|
||||
router.get('/raw/:id', function(request, response) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue