我想通过一些变量从第一个中间件到另一个中间件,我试着这样做,但有&;req.somevariable
是一个给定为“未定义”&;
//app.js
..
app.get('/someurl/', middleware1, middleware2)
...
////middleware1
...
some conditions
...
res.somevariable = variable1;
next();
...
////middleware2
...
some conditions
...
variable = req.somevariable;
...