first commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
const allowedOrigins = process.env.ALLOWED_ORIGINS.split(',').map(origin => origin.trim());
|
||||
|
||||
module.exports = {
|
||||
origin: function(origin, callback) {
|
||||
if (!origin) return callback(null, true);
|
||||
if (allowedOrigins.includes(origin)) {
|
||||
return callback(null, true);
|
||||
}
|
||||
return callback(new Error('CORS: Origin not allowed'), false);
|
||||
},
|
||||
credentials: true
|
||||
};
|
||||
Reference in New Issue
Block a user