Skip to content

Commit 88fee45

Browse files
committed
add error log for health check
1 parent d23c49e commit 88fee45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ app.get("/health", (req, res) => {
2828
}
2929
});
3030

31-
// If any environment variables are missing, return an error
31+
// If any environment variables are missing, log and return an error
3232
if (missingEnvVars.length > 0) {
33+
console.error("Missing environment variables:", missingEnvVars);
3334
return res.status(500).json({
3435
status: "error",
3536
message: "Missing environment variables",
@@ -42,6 +43,7 @@ app.get("/health", (req, res) => {
4243

4344
connection.ping((err) => {
4445
if (err) {
46+
console.error("Database connection failed:", err);
4547
return res.status(500).json({
4648
status: "error",
4749
message: "Database connection failed",

0 commit comments

Comments
 (0)