title: How do I pass a parameter to express.js Router?
body: <p>Here's a modified example from Express.js's <a href="http://expressjs.com/guide/routing.html" rel="noreferrer">routing guide</a>:</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  
  router.get('/', function(req, res) {
    res.send('Birds home page');
  });
  
  router.get('/about', function(req, res) {
    res.send('About birds');
  });
  
  ...
  app.use('/birds', router);
  app.use('/fish', router);
  </code></pre>
  
  <p>This prints "About birds" when I visit both <code>/birds/about</code> and <code>/fish/about</code>.</p>
  
  <p>How do I pass a parameter or something to the router so, in the controller functions, it can tell those two different routes apart? </p>
  
  <p>For example, I'd like to see "Birds can fly" when visiting <code>/birds/about</code> and "Fish can swim" when visiting <code>/fish/about</code>.</p>
  
  <p>Ideally, I'd like to be able to pass some "configuration object" so the mini-app does not need to know about all possible routes it may be mounted at (in pseudocode):</p>
  
  <pre><code>    router.get('/about', function(req, res) {
        res.send(magic_configuration.about_text);
      });
     ....
     magically_set_config(router, {about_text: "Bears eat fish"})
     app.use('/bears', router);
  </code></pre>