fix: socket

This commit is contained in:
AzizbekFayziyev 2025-07-04 19:08:52 +05:00
parent 19d34a4d15
commit c8b5f66574
2 changed files with 9 additions and 3 deletions

View file

@ -1 +1,2 @@
API_URL="http://localhost:3000"
API_URL="backend url"
NEXT_PUBLIC_URL="backend url"

View file

@ -1,5 +1,10 @@
import io from 'socket.io-client';
import { io } from 'socket.io-client';
const socket = io();
const SOCKET_URL = process.env.NEXT_PUBLIC_API_URL as string;
const socket = io(SOCKET_URL, {
transports: ['websocket'],
withCredentials: true,
});
export default socket;