fix: socket
This commit is contained in:
parent
19d34a4d15
commit
c8b5f66574
2 changed files with 9 additions and 3 deletions
|
|
@ -1 +1,2 @@
|
|||
API_URL="http://localhost:3000"
|
||||
API_URL="backend url"
|
||||
NEXT_PUBLIC_URL="backend url"
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue