diff --git a/backend/db.js b/backend/db.js index 7b25f75..0b7a973 100644 --- a/backend/db.js +++ b/backend/db.js @@ -2,6 +2,9 @@ // All route files import this module instead of receiving a sqlite3 `db` parameter. // Configured via DATABASE_URL environment variable. +// Ensure dotenv is loaded before accessing env vars +require('dotenv').config({ path: require('path').join(__dirname, '.env') }); + const { Pool } = require('pg'); if (!process.env.DATABASE_URL) {