From ccbdbeab60c2f9468c245d30eebb9f269030ff98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lobo?= Date: Tue, 6 Feb 2024 09:04:27 +0000 Subject: [PATCH] fix: socket --- pages/api/notifications.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/api/notifications.ts b/pages/api/notifications.ts index f0b9b6f4..6f09cc33 100644 --- a/pages/api/notifications.ts +++ b/pages/api/notifications.ts @@ -20,7 +20,12 @@ function handleError(e: any) { const ioHandler = async (req, res) => { if (!res.socket.server.io) { - const io = new Server(res.socket.server); + const io = new Server(res.socket.server, { + cors: { + origin: "*", + }, + addTrailingSlash: false + }); io.on("connection", (socket) => { Object.keys(fetchers).forEach((key) => {