From 0aa2ae16370112d618fe74920de9d639f388b5f2 Mon Sep 17 00:00:00 2001 From: b3ni15 Date: Sun, 21 Dec 2025 00:01:41 +0100 Subject: [PATCH] Update dotenv configuration to specify environment file path --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 85e11c6..4cc1274 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,6 @@ import dotenv from 'dotenv'; +import path from 'path'; +import { fileURLToPath } from 'url'; import express from 'express'; import http from 'http'; import cors from 'cors'; @@ -11,7 +13,8 @@ import walletRoutes from './routes/wallet.js'; import pool from './db.js'; import { setupWebSocket } from './ws.js'; -dotenv.config(); +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +dotenv.config({ path: path.join(__dirname, '..', '.env') }); const app = express();