为所有视图定义自定义变量
module.exports.routes = {
// This function will be executed for all http verbs on all urls
'all /*', function (req, res, next) {
// Expose the function `fooBar` to all views (via the locals object)
res.locals.fooBar = function (arg1) {
return 'foobar' + arg1;
};
},
};