fix: append /api prefix to endpoints in simulation script

This commit is contained in:
Hamza-Ayed
2026-07-18 19:49:27 +03:00
parent 964b076c84
commit 71f6ab92e4
+4 -3
View File
@@ -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;