From eb53561fa353b5963bd67f09ac7b5b5c5d208640 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 8 Dec 2022 21:50:38 +0100 Subject: [PATCH] add api health check --- scripts/server-backend.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/server-backend.js b/scripts/server-backend.js index 4ad7501..fa0c3e1 100644 --- a/scripts/server-backend.js +++ b/scripts/server-backend.js @@ -34,6 +34,19 @@ function startBackendServer(port) { app.use(express.static(path.join(__dirname, "..", "dist"))); app.use("/uploads", express.static(path.join(__dirname, "..", "public", "uploads"))); + /** + * @api {get} /api/health Health Check + * @apiDescription This returns nothing but a status code of 200 + * @apiName health + * @apiGroup WhiteboardAPI + * + * @apiSuccess {Number} 200 OK + */ + app.get("/api/health", function (req, res) { + res.status(200); //OK + res.end(); + }); + /** * @api {get} /api/loadwhiteboard Get Whiteboard Data * @apiDescription This returns all the Available Data ever drawn to this Whiteboard