2 parents 0c52dc2 + 1e0384f commit 61c7b3cCopy full SHA for 61c7b3c
1 file changed
backend/src/index.ts
@@ -1,4 +1,15 @@
1
import "dotenv/config";
2
+
3
+const REQUIRED_ENV_VARS = ["DATABASE_URL", "DIRECT_URL"];
4
5
+for (const key of REQUIRED_ENV_VARS) {
6
+ if (!process.env[key]) {
7
+ console.error(`[startup] Missing required environment variable: ${key}`);
8
+ console.error("Check backend/.env.example for the full list of required variables.");
9
+ process.exit(1);
10
+ }
11
+}
12
13
import { app } from "./app.js";
14
15
const port = Number(process.env.PORT ?? 4000);
0 commit comments