cors
cors copied to clipboard
How to set multiple domains ?
I tried
app.use(cors({
origin: function (ctx) {
if (['https://www.example1.com', 'https://www.example2.com'].includes(ctx.get('Origin'))) {
return ctx.get('Origin');
}
return null;
}
}));
But it doesn't work, any solution ?
See https://github.com/koajs/cors/issues/52#issuecomment-413887382
@vdegenne weird, my solution is the same as the comment you refer to but It couldn't work in my situation.