From 1081f921d4efe6984d6703273cdb535fc6276691 Mon Sep 17 00:00:00 2001 From: Mike Johnston Date: Thu, 29 Jan 2026 02:41:30 -0500 Subject: [PATCH] lets go --- frontend/src/SocketContext.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/SocketContext.jsx b/frontend/src/SocketContext.jsx index 41514da..2a37cf0 100644 --- a/frontend/src/SocketContext.jsx +++ b/frontend/src/SocketContext.jsx @@ -31,9 +31,12 @@ export function SocketProvider({ children }) { console.log('🔄 Initializing socket connection...'); - // Determine backend URL - const backendUrl = import.meta.env.VITE_API_URL || + // Determine backend URL (strip /api if present since socket.io is at root) + let backendUrl = import.meta.env.VITE_API_URL || (import.meta.env.DEV ? 'http://localhost:4000' : window.location.origin); + + // Remove /api suffix if present + backendUrl = backendUrl.replace(/\/api$/, ''); console.log('🌐 Connecting to:', backendUrl);