title: Why is req.params returning undefined?
body: <p>I've checked two similar questions here and neither of the things suggested in the comments are working for me.</p>
  
  <pre><code>app.get('/:id', function(req,res) {
    console.log(req.params.id);
  });
  
  app.get('/:id', function(req, res) {
    db.query("SELECT * FROM entries WHERE id = $1", [req.params.id], function(err, dbRes) {
      if (!err) {
        res.render('show', { entry: dbRes.rows[0] });
      }
    });
  });
  </code></pre>
  
  <p>As you can see, I've tried logging the result to the console to see what's going on. Visiting the URL in question just makes the page load until it times out. In the console, I get "undefined".</p>
  
  <p>How do I define req.params? Or where is it's definition being pulled and why isn't it returning the values?</p>
  
  <p>Full context: <a href="http://pastebin.com/DhWrPvjP" rel="nofollow">http://pastebin.com/DhWrPvjP</a></p>