Skip to content

Commit 5cc5146

Browse files
committed
fix: update health check endpoint to return detailed status information
1 parent 80e74f6 commit 5cc5146

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Back-end/app.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ app.use(cors(corsOptions));
6565
app.use("/api/v1/user", userRoute);
6666
app.use("/api/v1/chat", chatRoute);
6767
app.use("/api/v1/admin", adminRoute);
68-
app.use("/api/v1/health", (req, res) => {
69-
res.status(200).json({ status: "success", message: "API is healthy" });
68+
app.get("/api/v1/health", (req, res) => {
69+
res.status(200).json({
70+
status: "ok",
71+
uptime: process.uptime(),
72+
timestamp: new Date().toISOString(),
73+
environment: process.env.NODE_ENV || "PRODUCTION",
74+
});
7075
});
7176

7277
app.get("/", (req, res) => {

0 commit comments

Comments
 (0)