From 1c3a6cd38de6e43f83676c355375276441947f6c Mon Sep 17 00:00:00 2001 From: Ramprasad Date: Mon, 11 Nov 2024 19:37:25 +0530 Subject: [PATCH] origin changes --- src/index.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/index.ts b/src/index.ts index 1e85897..d3ee4fa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,12 +7,7 @@ import cors from "cors"; const app = express(); // Set up CORS middleware for Express -app.use( - cors({ - origin: "http://localhost:4200", // Update this to the origin of your client - methods: ["GET", "POST"], - }) -); +app.use(cors()); // Create an HTTP server const httpServer: HTTPServer = createServer(app); @@ -21,7 +16,7 @@ const httpServer: HTTPServer = createServer(app); const io = new SocketIOServer(httpServer, { path: "/socket", // Define the WebSocket path cors: { - origin: "http://localhost:4200", // Update this to the origin of your client + origin: "*", // Update this to the origin of your client methods: ["GET", "POST"], }, });