Load backend env file reliably
Этот коммит содержится в:
@@ -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;
|
||||
|
||||
Ссылка в новой задаче
Block a user