diff --git a/front/src/main.tsx b/front/src/main.tsx index 275ef2f..5af230a 100644 --- a/front/src/main.tsx +++ b/front/src/main.tsx @@ -11,10 +11,16 @@ import CreateChannel from './pages/CreateChannel' import ChannelsPage from './pages/ChannelsPage' const socket = new WebSocket("/api/ws"); + setInterval(() => { socket.send(JSON.stringify({ type: "ping" })); }, 30 * 1000); +socket.addEventListener('message', function (event) { + const data = JSON.parse(event.data); + console.log(data); +}); + createRoot(document.getElementById('root')!).render(