Skip to content

Commit c772337

Browse files
committed
chore: add conditional CORS whitelist for local development
1 parent 42e24e8 commit c772337

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎backend/app.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ const dashboardLimiter = rateLimit({
2323

2424
const adminWhitelist = ['https://urbackend.bitbros.in'];
2525

26+
// to allow localhost in developmentt
27+
if (process.env.NODE_ENV === 'development') {
28+
adminWhitelist.push('http://localhost:5173');
29+
}
30+
2631
const adminCorsOptions = {
2732
origin: function (origin, callback) {
2833
// Allow requests with no origin (like mobile apps or curl)

0 commit comments

Comments
 (0)