Skip to content

Commit 25f93c2

Browse files
committed
feat: Enhance health check endpoint to include environment variable status
1 parent 19b5d76 commit 25f93c2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

RENDER_ENV_VARS.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Copy and paste these environment variables in Render:
1+
# CRITICAL: Copy and paste these environment variables in Render:
2+
# Make sure BOTH MongoDB variables are set (for compatibility)
23

34
NODE_ENV=production
45
PORT=10000

api/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ app.use("/api/invoices", invoiceRoutes);
3939

4040
// Health check endpoint
4141
app.get("/api/health", (req, res) => {
42+
const mongoUri = process.env.MONGO_URI || process.env.MONGODB_URI;
4243
res.status(200).json({
4344
status: "OK",
4445
timestamp: new Date().toISOString(),
4546
environment: process.env.NODE_ENV || "development",
47+
mongoUri: mongoUri ? "✅ Set" : "❌ Missing",
48+
redisUrl: process.env.REDIS_URL ? "✅ Set" : "❌ Missing",
49+
emailUser: process.env.EMAIL_USER ? "✅ Set" : "❌ Missing",
4650
});
4751
});
4852

0 commit comments

Comments
 (0)