Last active
November 13, 2019 17:52
-
-
Save paulogdm/1a445e48078a8ca32e128b7b946b04fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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