()
| 40 | |
| 41 | // Load environment variables from .env file |
| 42 | function loadEnvFile() { |
| 43 | const envPath = path.join(__dirname, '..', '.env'); |
| 44 | if (fs.existsSync(envPath)) { |
| 45 | const envContent = fs.readFileSync(envPath, 'utf8'); |
| 46 | const lines = envContent.split('\n'); |
| 47 | |
| 48 | lines.forEach(line => { |
| 49 | const trimmedLine = line.trim(); |
| 50 | if (trimmedLine && !trimmedLine.startsWith('#')) { |
| 51 | const [key, ...valueParts] = trimmedLine.split('='); |
| 52 | if (key && valueParts.length > 0) { |
| 53 | const value = valueParts.join('=').trim(); |
| 54 | process.env[key.trim()] = value; |
| 55 | } |
| 56 | } |
| 57 | }); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // Load environment variables |
| 62 | loadEnvFile(); |
no outgoing calls
no test coverage detected
searching dependent graphs…