title: Nodejs Express implicit middleware applied to all routes?
body: <p>I wanted to know if Express would let me create a route middleware that would be called by default without me explicitly placing it on the app.get() arg list?</p>
  
  <p>// NodeJS newb</p>
  
  <pre><code>var data = { title: 'blah' };
  
  // So I want to include this in every route
  function a(){
    return function(req, res){
      req.data = data;
    };
  };
  
  app.get('/', function(req, res) {
    res.render('index', { title: req.data.title });
  };
  </code></pre>
  
  <p>I understand I can do <code>app.set('data', data)</code> and access it via <code>req.app.settings.data</code> in the route.  Which would probably satisfy my simple example above.</p>