feat: add /health endpoint to check API is up

This commit is contained in:
Thomas Bishop 2025-10-17 18:52:06 +01:00 committed by forgejo-actions[bot]
parent 392535ecdf
commit e123b9e1ec
2 changed files with 7 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "eolas-api", "name": "eolas-api",
"version": "0.2.2", "version": "0.3.0",
"description": "API for querying eolas-db, my Zettelkasten database", "description": "API for querying eolas-db, my Zettelkasten database",
"license": "ISC", "license": "ISC",
"author": "Thomas Bishop", "author": "Thomas Bishop",

View file

@ -17,3 +17,7 @@ app.listen(port, () => {
console.info(`TB-INFO eolas-api running on NodeJS ${process.version}`) console.info(`TB-INFO eolas-api running on NodeJS ${process.version}`)
console.info(`TB-INFO eolas-api server running at http://localhost:${port}`) console.info(`TB-INFO eolas-api server running at http://localhost:${port}`)
}) })
app.get("/health", (req, res) => {
res.status(200).json({ status: ok })
})