Commit 9f87535a authored by Nick's avatar Nick

feat: healthz endpoint

parent 6041b169
......@@ -18,6 +18,17 @@ router.get('/robots.txt', (req, res, next) => {
})
/**
* Health Endpoint
*/
router.get('/healthz', (req, res, next) => {
if (WIKI.models.knex.client.pool.numFree() < 1 && WIKI.models.knex.client.pool.numUsed() < 1) {
res.status(503).json({ ok: false }).end()
} else {
res.status(200).json({ ok: true }).end()
}
})
/**
* Create/Edit document
*/
router.get(['/e', '/e/*'], async (req, res, next) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment