**在app中设置了一个配置,加了一个router,如何在router中获取这个设置
在app.js中
var users = require('./routes/users');
app.set('upload', path.join(__dirname, 'public/upload'));
app.use('/users', users);
在./routes/users文件中
var express = require('express');
var router = express.Router();
router.post('/upload', function(req, res, next) {
//向将上传的文件保存到目录public/upload,如何获得在app.js文件中upload这个设置?
var upload = app.get('upload');
});
module.exports = router;**
You can get it like this