diff --git a/backend/index.js b/backend/index.js index 6a3aaf84..9b301e1c 100644 --- a/backend/index.js +++ b/backend/index.js @@ -9,6 +9,8 @@ dotenv.config(); const app = express(); const port = process.env.PORT || 3000; + + // CORS configuration app.use( cors({ @@ -16,6 +18,11 @@ app.use( }) ); +// CORS configuration +const corsOptions = { + origin: ["http://localhost:5173", "https://play-cafe.vercel.app"], +}; + app.use(express.json()); // MongoDB connection