Fondation

This commit is contained in:
alma 2026-01-16 21:17:22 +01:00
parent 640d0fc1b3
commit f645103946

View File

@ -11,6 +11,23 @@
* npm run validate:env
*/
// Load environment variables from .env file
const dotenv = require('dotenv');
const path = require('path');
const fs = require('fs');
// Try to load .env file
const envPath = path.resolve(process.cwd(), '.env');
if (fs.existsSync(envPath)) {
dotenv.config({ path: envPath });
console.log(`✅ Loaded environment variables from ${envPath}\n`);
} else {
console.warn(`⚠️ Warning: .env file not found at ${envPath}`);
console.warn(' Trying to load from process.env only...\n');
// Still try to load from current directory
dotenv.config();
}
const requiredVars = [
// Core
'DATABASE_URL',