corrected cors origin

This commit is contained in:
Moon Patel
2023-09-14 00:13:08 +05:30
parent 4cca4b6527
commit 164da1ffee
+1 -1
View File
@@ -23,7 +23,7 @@ const { socketIOServerInit } = require("./socket");
app.get("/health-check", (req, res, next) => {
res.status(200).send("OK");
});
app.use(cors({ origin: `http://${process.env.CORS_ORIGIN}:5173`, credentials: true }));
app.use(cors({ origin: process.env.CORS_ALLOWED_HOST, credentials: true }));
app.use(bodyParser.json());
app.use((req, res, next) => {
// res.setHeader("Access-Control-Allow-Origin", "http://localhost:5173");