-
-
Save nomoney4me/e8adff740e925048a3a03e9757c30d1d 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
| let middleware = (req, res, next) => { | |
| req.user = { | |
| username: 'foo' | |
| } | |
| next() | |
| } | |
| app.get('/', middleware, (req, res) => { | |
| // # req.user is available here | |
| console.log(req.user) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment