How does Express Router get global settings

  node.js, question

* * A configuration is set in app and a router is added. How can I get this setting in router?

In app.js
 var users = require('./routes/users');
 app.set('upload', path.join(__dirname, 'public/upload'));
 app.use('/users', users);
 In the. /routes/users file
 var express = require('express');
 var router = express.Router();
 router.post('/upload', function(req, res, next) {
 //To save the uploaded file to the directory public/upload, how can I obtain the setting of upload in the app.js file?
 var upload = app.get('upload');
 });
 
 module.exports = router;  **

You can get it this way.

var upload = req.app.get('upload');