Load backend env file reliably

Этот коммит содержится в:
Виктор
2026-05-08 17:37:33 +09:00
родитель 1bf33f0673
Коммит 4f6339b37c
+7 -1
Просмотреть файл
@@ -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;