我将如何确保特定对象可用于我以 express 处理的每个请求?
var somethingImportant = "really important";
var app = express();
// This is just a hypothetical example of what I'm after...
app.mixThisInWithRequest({
somethingImportant: somethingImportant
});
app.use(function (request, response, next) {
console.log(request.somethingImportant);
});
鉴于上面的示例,是否有类似于该mixThisInWithRequest
功能的设施?