title: How to stop losing request parameters in expressjs?
body: <p>I have defined my route in a separate <code>route.js</code> file as below (details removed for brevity)</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  router.route('')put(function(req, res){
      console.log(req.params.id); //prints undefined
  });
  </code></pre>
  
  <p>and in <code>server.js</code> I map this route as below</p>
  
  <pre><code>var route = require('./routes/route.js');
  app.use('/api/use/:id/role', route);
  </code></pre>
  
  <p>My route function is correctly invoked but the <code>id</code> parameter is not available in the router handler. Am I doing anything wrong?</p>