From 71f6ab92e4554cf8bb805c5f7e953b5c7767873e Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sat, 18 Jul 2026 19:49:27 +0300 Subject: [PATCH] fix: append /api prefix to endpoints in simulation script --- backend/e2e-tester/simulation.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/e2e-tester/simulation.js b/backend/e2e-tester/simulation.js index 963bed0..9186208 100644 --- a/backend/e2e-tester/simulation.js +++ b/backend/e2e-tester/simulation.js @@ -1,7 +1,7 @@ import readline from 'readline'; import { io } from 'socket.io-client'; -const API_URL = process.env.API_URL || 'http://localhost:4010'; +const API_URL = process.env.API_URL || 'http://localhost:4010/api'; const TENANT_ID = 'tripz'; // Change this if you have a different slug const rl = readline.createInterface({ @@ -68,8 +68,9 @@ async function run() { // 3. Connect WebSockets console.log(`[Sockets] Connecting Rider and Driver via WebSockets...`); - const driverSocket = io(API_URL, { extraHeaders: { Authorization: `Bearer ${driverToken}` } }); - const riderSocket = io(API_URL, { extraHeaders: { Authorization: `Bearer ${riderToken}` } }); + const WS_URL = API_URL.replace('/api', ''); + const driverSocket = io(WS_URL, { extraHeaders: { Authorization: `Bearer ${driverToken}` } }); + const riderSocket = io(WS_URL, { extraHeaders: { Authorization: `Bearer ${riderToken}` } }); let tripId = null;