fix: Correct dirname for the app config

This commit is contained in:
Faruk AYDIN
2024-01-08 12:24:53 +01:00
parent 879aa1f9f8
commit 0804026d74

View File

@@ -2,6 +2,9 @@ import { URL } from 'node:url';
import * as dotenv from 'dotenv'; import * as dotenv from 'dotenv';
import path from 'path'; import path from 'path';
import process from 'node:process'; import process from 'node:process';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
if (process.env.APP_ENV === 'test') { if (process.env.APP_ENV === 'test') {
dotenv.config({ path: path.resolve(__dirname, '../../.env.test') }); dotenv.config({ path: path.resolve(__dirname, '../../.env.test') });