fix: remove hardcoded database URLs and use environment variables
This commit is contained in:
@@ -9,8 +9,12 @@ const { execSync } = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Load .env file if it exists
|
||||
// Load .env.development file first (if it exists), then .env file
|
||||
const envDevPath = path.resolve(__dirname, '..', '.env.development');
|
||||
const envPath = path.resolve(__dirname, '..', '.env');
|
||||
if (fs.existsSync(envDevPath)) {
|
||||
require('dotenv').config({ path: envDevPath });
|
||||
}
|
||||
if (fs.existsSync(envPath)) {
|
||||
require('dotenv').config({ path: envPath });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user