Commit 71d4a53e authored by AravindR-K's avatar AravindR-K

updated

parent 1fdd41b6
......@@ -14,11 +14,18 @@ const app = express();
// Middleware
app.use(cors({
origin: [
origin: function (origin, callback) {
const allowed = [
'http://localhost:4200',
'https://quiz-master-oxo7-4r2hvqr2w-aravind05rk.vercel.app',
process.env.FRONTEND_URL
].filter(Boolean),
];
// Allow any origin that ends with 'vercel.app' or is directly allowed
if (!origin || allowed.includes(origin) || origin.endsWith('vercel.app')) {
callback(null, true);
} else {
callback(null, false);
}
},
credentials: true
}));
app.use(express.json());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment