micro-cors: Error with microrouter
My code:
import micro from 'micro'
import auth from './auth'
import routes from './routes'
import cors from 'micro-cors'
micro(cors(auth(routes))).listen(3000)
then I get
TypeError: "string" must be a string, Buffer, or ArrayBuffer
at Function.byteLength (buffer.js:441:11)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 8
- Comments: 18 (8 by maintainers)
I use
microrouter
andmicro-cors
in my apis, here’s how I do it:use
const cors = require('micro-cors')()
It is important to include
()