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