Fondation
This commit is contained in:
parent
640d0fc1b3
commit
f645103946
@ -11,6 +11,23 @@
|
|||||||
* npm run validate:env
|
* 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 = [
|
const requiredVars = [
|
||||||
// Core
|
// Core
|
||||||
'DATABASE_URL',
|
'DATABASE_URL',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user