origin changes
This commit is contained in:
parent
623bb7f464
commit
1c3a6cd38d
@ -7,12 +7,7 @@ import cors from "cors";
|
|||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
// Set up CORS middleware for Express
|
// Set up CORS middleware for Express
|
||||||
app.use(
|
app.use(cors());
|
||||||
cors({
|
|
||||||
origin: "http://localhost:4200", // Update this to the origin of your client
|
|
||||||
methods: ["GET", "POST"],
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create an HTTP server
|
// Create an HTTP server
|
||||||
const httpServer: HTTPServer = createServer(app);
|
const httpServer: HTTPServer = createServer(app);
|
||||||
@ -21,7 +16,7 @@ const httpServer: HTTPServer = createServer(app);
|
|||||||
const io = new SocketIOServer(httpServer, {
|
const io = new SocketIOServer(httpServer, {
|
||||||
path: "/socket", // Define the WebSocket path
|
path: "/socket", // Define the WebSocket path
|
||||||
cors: {
|
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"],
|
methods: ["GET", "POST"],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user