title: Encapsulate Express Routers
body: <p>Is it possible to create different routers using Express.Router that don't share middleware? </p>
  
  <p>To me it seems that Express.Router uses a singleton, so no matter what I try, the middleware gets attached to all routers. So, without having to create multiple instances of the Express app, is there a way to achieve the following:</p>
  
  <p><strong>Create mutliple routers</strong></p>
  
  <pre><code>var router_a = Express.Router();
  var router_b = Express.Router();
  </code></pre>
  
  <p><strong>Give each router unique routes and middleware</strong></p>
  
  <pre><code>router_a.use(function(req, res, next){
      console.log('Only works on router_a!');
  });
  router_a.get('/', function(req, res){
      console.log('Only works on router_a!');
  });
  
  router_b.use(function(req, res, next){
      console.log('Only works on router_b!');
  });
  router_b.get('/', function(req, res){
      console.log('Only works on router_b!');
  });
  </code></pre>
  
  <p><strong>Attach each route to a custom url namespace</strong></p>
  
  <pre><code>app.use('/a', router_a);
  app.use('/b', router_b);
  </code></pre>
  
  <p>Is there a straight forward way to achieve this? After reading through the docs on the Router I don't see anything that suggests such is possible.</p>