File size: 488 Bytes
5bd3663
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
 * Environment loader — must be the FIRST import in index.js.
 *
 * ES module imports are hoisted, so dotenv.config() must run
 * inside a module that is imported before any module that reads
 * process.env at the top level.
 */

import dotenv from "dotenv";
import { fileURLToPath } from "url";
import { dirname, join } from "path";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

dotenv.config({ path: join(__dirname, "../../.env") });