From af25c4b5fc08304f743db40e77aa476a8ce50e43 Mon Sep 17 00:00:00 2001 From: Manik Maity Date: Fri, 8 Nov 2024 22:07:58 +0530 Subject: [PATCH] FIX - Cors Bug --- backend/src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/index.js b/backend/src/index.js index 56909b3..60f78e8 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -23,7 +23,10 @@ const io = new Server(httpServer, { }) app.use(cookieParser()); -app.use(cors()) +app.use(cors({ + origin: "http://localhost:5173", + credentials: true +})) app.use(express.json()) app.get("/ping", (_req, res) => { res.json({ message: "pong" })