|
|
@ -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"], |
|
|
|
}, |
|
|
|
}); |
|
|
|