adding socket.js for creating websocket connections

This commit is contained in:
Mose Müller 2023-08-02 12:06:19 +02:00
parent 919f83c77e
commit c2845a0419

6
frontend/src/socket.ts Normal file
View File

@ -0,0 +1,6 @@
import { io } from 'socket.io-client';
const URL = 'ws://localhost:8001/';
// process.env.NODE_ENV === 'production' ? undefined : 'ws://localhost:8001/ws';
export const socket = io(URL, { path: '/ws/socket.io', transports: ['websocket'] });