how to set options?
csrgxtu opened this issue · 2 comments
csrgxtu commented
how do i set options
artworkad commented
@csrgxtu should be cors(options) https://github.com/koajs/cors/blob/master/index.js#L19
wesleyboar-fka-iosulfur commented
To answer, I present one change to the final statement from the example code in "Quick Start" of README.md
at tag 3.0.0
:
const Koa = require('koa');
const cors = require('@koa/cors');
const app = new Koa();
app.use(cors({
// …
allowMethods: 'GET,HEAD',
keepHeadersOnError: true,
// …
}));
Does this help?
Edit: The post is three years old. 😅