We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
用关键词 express.js middleware pass data to next Google,找到答案:Passing variables to the next middleware using next() in Express.js。
express.js middleware pass data to next
简单来说,就是在中间件里把需要传递的值放到 res.locals 中,比如 res.locals.varr = varr,然后在下一个函数里就可以通过 res.locals.varr 来调用了。
res.locals
res.locals.varr = varr
res.locals.varr
官方文档:res.locals。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
解决过程
用关键词
express.js middleware pass data to next
Google,找到答案:Passing variables to the next middleware using next() in Express.js。简单来说,就是在中间件里把需要传递的值放到
res.locals
中,比如res.locals.varr = varr
,然后在下一个函数里就可以通过res.locals.varr
来调用了。官方文档:res.locals。
The text was updated successfully, but these errors were encountered: