1 parent 392c8a3 commit 1e0384fCopy full SHA for 1e0384f
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