From bf1d48709c19e36c489430257dfad61348a03dfe Mon Sep 17 00:00:00 2001 From: chamiakJ Date: Mon, 28 Apr 2025 16:22:54 +0530 Subject: [PATCH] Enhance backend API with health check endpoint and update environment script - Added a new health check endpoint to the public router in index.ts, returning a simple status response. - Updated update-docker-env.sh to include the MinIO Dashboard URL in the environment configuration and output messages. --- update-docker-env.sh | 2 ++ worklenz-backend/src/routes/public/index.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/update-docker-env.sh b/update-docker-env.sh index c5274d7c..bfcca1ae 100755 --- a/update-docker-env.sh +++ b/update-docker-env.sh @@ -21,6 +21,7 @@ fi # Frontend URLs FRONTEND_URL="${HTTP_PREFIX}${HOSTNAME}:5000" +MINIO_DASHBOARD_URL="${HTTP_PREFIX}${HOSTNAME}:9001" # Create or overwrite frontend .env.development file mkdir -p worklenz-frontend @@ -128,4 +129,5 @@ echo echo "Frontend URL: ${FRONTEND_URL}" echo "API URL: ${HTTP_PREFIX}${HOSTNAME}:3000" echo "Socket URL: ${WS_PREFIX}${HOSTNAME}:3000" +echo "MinIO Dashboard URL: ${MINIO_DASHBOARD_URL}" echo "CORS is configured to allow requests from: ${FRONTEND_URL}" \ No newline at end of file diff --git a/worklenz-backend/src/routes/public/index.ts b/worklenz-backend/src/routes/public/index.ts index 956c4ab4..5d088d6c 100644 --- a/worklenz-backend/src/routes/public/index.ts +++ b/worklenz-backend/src/routes/public/index.ts @@ -5,5 +5,8 @@ import safeControllerFunction from "../../shared/safe-controller-function"; const public_router = express.Router(); public_router.post("/new-subscriber", safeControllerFunction(ClientsController.addSubscriber)); +public_router.get("/health", (req, res) => { + res.status(200).json({ status: "ok" }); +}); export default public_router;