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();