From e123b9e1ec984b6a761957778be92595ee42db05 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Fri, 17 Oct 2025 18:52:06 +0100 Subject: [PATCH] feat: add /health endpoint to check API is up --- package.json | 2 +- src/index.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6e1ea6d..546e3ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eolas-api", - "version": "0.2.2", + "version": "0.3.0", "description": "API for querying eolas-db, my Zettelkasten database", "license": "ISC", "author": "Thomas Bishop", diff --git a/src/index.js b/src/index.js index ceffa6e..7a9e20d 100644 --- a/src/index.js +++ b/src/index.js @@ -14,6 +14,10 @@ app.use("/entries", entries) app.use("/tags", tags) app.listen(port, () => { - 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 running on NodeJS ${process.version}`) + console.info(`TB-INFO eolas-api server running at http://localhost:${port}`) +}) + +app.get("/health", (req, res) => { + res.status(200).json({ status: ok }) })