Passing variables to the next middleware using next() in Express.js

后端 未结 6 1441
长情又很酷
长情又很酷 2020-11-27 10:11

Well, my question is I want to pass some variable from the first middleware to another middleware, and I tried doing this, but there was \"req.somevariable is a

6条回答
  •  悲&欢浪女
    2020-11-27 10:30

    That's because req and res are two different objects.

    You need to look for the property on the same object you added it to.

提交回复
热议问题