diff --git a/backend/src/config.js b/backend/src/config.js index 935e3ce..7c766b6 100644 --- a/backend/src/config.js +++ b/backend/src/config.js @@ -1,6 +1,12 @@ import dotenv from 'dotenv'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; -dotenv.config(); +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const envPath = resolve(__dirname, '../.env'); + +dotenv.config({ path: envPath }); const bool = (value, fallback = false) => { if (value === undefined || value === null || value === '') return fallback;