add view socket
This commit is contained in:
parent
0d40e4d052
commit
36bef713e8
@ -21,9 +21,13 @@ const app = express();
|
|||||||
const server = createServer(app);
|
const server = createServer(app);
|
||||||
|
|
||||||
// Socket.IO setup with CORS
|
// Socket.IO setup with CORS
|
||||||
|
const ORIGIN_URL =
|
||||||
|
process.env.NODE_ENV === "production"
|
||||||
|
? "https://med.tomastm.com"
|
||||||
|
: "http://localhost:5173";
|
||||||
const io = new Server(server, {
|
const io = new Server(server, {
|
||||||
cors: {
|
cors: {
|
||||||
origin: "http://localhost:5173", // React app URL
|
origin: ORIGIN_URL,
|
||||||
methods: ["GET", "POST"],
|
methods: ["GET", "POST"],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user