lets go
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user