title: Express.js Middleware - Adding items to the response object model
body: <p>I'm playing around with Expressjs and am attempting to extract the page title from the default template to middleware instead of passed into the view's model each time.</p>
  
  <p><strong>Default index.jade template</strong></p>
  
  <pre><code>h1= title
  
  p Welcome to the #{title}
  </code></pre>
  
  <p><strong>Default route from template</strong></p>
  
  <pre><code>exports.index = function(req, res){
    res.render('index', { title: "Express" });
  };
  </code></pre>
  
  <p>I attempted the following but get an error from Express saying <code>title</code> is undefined when I do this.</p>
  
  <pre><code>module.exports = function(req, res, next){
      res.title = 'Express';
      next();
  }
  </code></pre>
  
  <p>This is obviously a trivial example but it's also something that I am trying to figure out since there will probably come a time where I want to inject things into the response's model after each route.  I just cannot figure out how to do such.</p>
  
  <p>Thanks</p>