add view socket

This commit is contained in:
Tomas Mirchev 2025-07-01 13:54:34 +00:00
parent 0d40e4d052
commit 36bef713e8

View File

@ -21,9 +21,13 @@ const app = express();
const server = createServer(app);
// 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, {
cors: {
origin: "http://localhost:5173", // React app URL
origin: ORIGIN_URL,
methods: ["GET", "POST"],
},
});