title: Redirect all trailing slashes globally in express
body: <p>I am using Node.js and Express and I have the following routing :</p>
  
  <pre><code>app.get('/', function(req,res){
      locals.date = new Date().toLocaleDateString();
  
      res.render('home.ejs', locals);
  });
  
  function lessonsRouter (req, res, next)
  {
      var lesson = req.params.lesson;
      res.render('lessons/' + lesson + '.ejs', locals_lessons);
  }
  
  app.get('/lessons/:lesson*', lessonsRouter);
  
  
  function viewsRouter (req, res, next)
  {
      var controllerName = req.params.controllerName;
      res.render(controllerName + '.ejs', locals_lessons);
  }
  app.get('/:controllerName', viewsRouter);
  </code></pre>
  
  <p>I have a <a href="http://disqus.com/">Disqus</a> widget on my lessons pages and I have noticed a strange behavior that when going to <code>myapp.com/lessons</code> and <code>myapp.com/lessons/</code> I get two different pages (on of them had a comment I previously added in Disqus and the other one doesn't have a comment).</p>
  
  <p>Is there a way to "canonize" all of my urls to be without trailing slashes ? I have tried to add the <code>strict routing</code> flag to express but the results were the same</p>
  
  <p>Thanks </p>