在Express中间件功能内部,是否有一种方法可以在传入其他任何中间件功能之前引用用于传入请求的原始URL?
例如:
req.originalUrl = '/users';
app.use('/login', function (req, res, next) {
// we are now inside of the /login middleware because we
need to authorize the current user
// at this point, can we still obtain a reference to the original /users?
})
谢谢!