From a8d1254f4e277695ece0ab624af3dd62db8c7430 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Fri, 26 Nov 2021 01:13:59 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=A2=20Added=20permissive=20CORS=20sett?= =?UTF-8?q?ings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/api.service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/api.service.ts b/services/api.service.ts index ef5ea33..64c9f2b 100644 --- a/services/api.service.ts +++ b/services/api.service.ts @@ -97,7 +97,14 @@ export default class ApiService extends Service { // Socket gateway-ish // Create a Socket.IO instance, passing it our server socketServer.listen(3001, `0.0.0.0`); - this.io = new Server(socketServer, {}); + this.io = new Server(socketServer, { + cors: { + origin: "*", + methods: "GET,HEAD,PUT,PATCH,POST,DELETE", + preflightContinue: false, + optionsSuccessStatus: 204, + }, + }); // Add a connect listener this.io.on("connection", (client) => { this.logger.info("Client connected via websocket!");