title: What is the order of execution of middlewares?
body: <p>I have two routes. First route inside global variable <code>route</code>. In start middleware, second route returns into that global variable also.</p>
  
  <pre><code>var route = require('./routes/first');
  
  app.use(function(req, res, next) {
      route = require('./routes/second');
      next();
  });
  </code></pre>
  
  <p>And when executed next middlawe I still have the first route. <strong>Why did my first middlawe does not start before?</strong></p>
  
  <pre><code>// route contain module from './routes/first'
  app.use('/api', route);
  </code></pre>
  
  <hr>
  
  <p>But, if I use different design of callback, it is possible to get a second route...</p>
  
  <pre><code>// route contain module from './routes/second'
  app.use('/api', function (req, res, next) {
      return route(req, res, next);
  });
  </code></pre>
  
  <hr>
  
  <p><strong>./routes/first.js</strong></p>
  
  <pre><code>var express = require('express');
  var route = express.Router();
  
  route.get('/', function(req, res) {
      res.send('First route');
  });
  
  module.exports = route;
  </code></pre>
  
  <p><strong>./routes/second.js</strong></p>
  
  <pre><code>var express = require('express');
  var route = express.Router();
  
  route.get('/', function(req, res) {
      res.send('Second route');
  });
  
  module.exports = route;
  </code></pre>