fix: append /api prefix to endpoints in simulation script
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import readline from 'readline';
|
import readline from 'readline';
|
||||||
import { io } from 'socket.io-client';
|
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 TENANT_ID = 'tripz'; // Change this if you have a different slug
|
||||||
|
|
||||||
const rl = readline.createInterface({
|
const rl = readline.createInterface({
|
||||||
@@ -68,8 +68,9 @@ async function run() {
|
|||||||
|
|
||||||
// 3. Connect WebSockets
|
// 3. Connect WebSockets
|
||||||
console.log(`[Sockets] Connecting Rider and Driver via WebSockets...`);
|
console.log(`[Sockets] Connecting Rider and Driver via WebSockets...`);
|
||||||
const driverSocket = io(API_URL, { extraHeaders: { Authorization: `Bearer ${driverToken}` } });
|
const WS_URL = API_URL.replace('/api', '');
|
||||||
const riderSocket = io(API_URL, { extraHeaders: { Authorization: `Bearer ${riderToken}` } });
|
const driverSocket = io(WS_URL, { extraHeaders: { Authorization: `Bearer ${driverToken}` } });
|
||||||
|
const riderSocket = io(WS_URL, { extraHeaders: { Authorization: `Bearer ${riderToken}` } });
|
||||||
|
|
||||||
let tripId = null;
|
let tripId = null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user