Skip to content

Instantly share code, notes, and snippets.

@paulogdm
Last active November 13, 2019 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulogdm/1a445e48078a8ca32e128b7b946b04fb to your computer and use it in GitHub Desktop.
Save paulogdm/1a445e48078a8ca32e128b7b946b04fb to your computer and use it in GitHub Desktop.
// a.js
module.exports = async (req, res) => {
await middleware(req, res)
}
// b.js
module.exports middleware( async (req, res) => {
// ...
})
// express.js
var app = express()
app.use('/user/:id', function (req, res, next) {
console.log('Request Type:', req.method)
next()
})
app.get('*', (req, res, next) => {
res.send('USER')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment