lets go
This commit is contained in:
@@ -31,9 +31,12 @@ export function SocketProvider({ children }) {
|
|||||||
|
|
||||||
console.log('🔄 Initializing socket connection...');
|
console.log('🔄 Initializing socket connection...');
|
||||||
|
|
||||||
// Determine backend URL
|
// Determine backend URL (strip /api if present since socket.io is at root)
|
||||||
const backendUrl = import.meta.env.VITE_API_URL ||
|
let backendUrl = import.meta.env.VITE_API_URL ||
|
||||||
(import.meta.env.DEV ? 'http://localhost:4000' : window.location.origin);
|
(import.meta.env.DEV ? 'http://localhost:4000' : window.location.origin);
|
||||||
|
|
||||||
|
// Remove /api suffix if present
|
||||||
|
backendUrl = backendUrl.replace(/\/api$/, '');
|
||||||
|
|
||||||
console.log('🌐 Connecting to:', backendUrl);
|
console.log('🌐 Connecting to:', backendUrl);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user