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:
Bruno Saboia de Albuquerque 2022-03-10 03:38:13 +01:00
commit 4c0bc186ae
2 changed files with 6 additions and 1 deletions

View file

@ -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\
)"]

View file

@ -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) {