Open
Description
Hello, I think it might be issue, please check this out:
this code below don't return any response from the server. neither error too.
const fs = require('fs')
const { router, get } = require('microrouter')
const bundle = (req, res) => {
res.statusCode = 200
const obj = fs.createReadStream('./dist/bundle.js')
res.setHeader('Content-Type', 'application/javascript')
obj.pipe(res)
}
module.exports = router(
get('/', bundle)
)
The same arrow function will work without router
functionality:
const fs = require('fs')
module.exports = (req, res) => {
res.statusCode = 200
const obj = fs.createReadStream('./dist/bundle.js')
res.setHeader('Content-Type', 'application/javascript')
obj.pipe(res)
}
Metadata
Assignees
Labels
No labels