title: Node Express.js access variables from routes declared in separate files
body: <p>I am currently developping a website that is using a lot of routes.
  At the beginning, all the routes were implemented in a same file...
  To make the things clearer, I decided to create multiple files, in order to separate the routes... using the Router module.</p>
  
  <p>For example, in my users.js file I have:</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  
  router.get('/', function(req, res, next) {
    res.send('respond with a resource');
  });
  
  module.exports = router;
  </code></pre>
  
  <p>and in my main app.js file :</p>
  
  <pre><code>app.use('/users', require('./routes/user');
  </code></pre>
  
  <p>This works perfectly but the thing is that I would like my 'users' route
  to access some variables that have been declared into the app.js file, before the <code>app.use(...)</code></p>
  
  <p>I know I can use <code>require</code> and <code>module.exports</code>, but some variables must be declared in my app.js, only one time, and I must access them from the routes I include.</p>