CORS middleware
yarn add @qiwi/mware-cors
npm i @qiwi/mware-cors
import cors from '@qiwi/mware-cors'
import express from 'express'
const app = express()
app.use(cors())
app.get('/foo/bar', (req, res) => {
res.send('foo')
})
/*
RES {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, HEAD, PATCH, PUT, POST, DELETE, OPTIONS'
...
},
...
}
*/
app.listen(...)
MIT