title: Express Middleware Issue
body: <p>On routes/index.js it works fine if I leave the module.exports  = routes;
  But If I change it to the following to allow multiple files then I get a middleware error:</p>
  
  <pre><code>module.exports = {
      routes
  };
  </code></pre>
  
  <hr>
  
  <pre><code>var app = express();
  const routes = require('./routes');
  const port = process.env.PORT || 3000;
  
  app.use(bodyParser.json());
  app.use('/', routes);
  
  
  
  app.get('/', (req, res) =&gt; {
      res.send('Please visit: http://domain.com');
      }, (err) =&gt; {
      res.send(err);
  });
  </code></pre>
  
  <hr>
  
  <p>//routes/index.js</p>
  
  <pre><code>const routes = require('./MainRoutes');
  module.exports = routes;
  </code></pre>
  
  <hr>
  
  <p>//routes/Main Routes.js</p>
  
  <pre><code>const routes = require('express').Router();
  routes.post('/main', (res, req) =&gt; {
     //code here works
  });
  module.exports = routes;
  </code></pre>
  
  <p>The error is: Router.use() requires middleware function but got a ' + gettype(fn));</p>