title: How come my views are not returned when exported from a file in my routes directory?
body: <p>I'm just experimenting with basic routing in ExpressJS and so far I have two routes:</p>
  
  <pre><code>app.get('/', function(req,res) {
    res.render('index');
  });
  
  app.get('/pics', function(req,res) {
    res.render('pics');
  });
  </code></pre>
  
  <p>When defined like this, in my app.js, everything works fine, but when exported as below, from individual files in my <code>routes</code> subdirectory, I get the error message that a callback function was expected, but an Object undefined was returned.</p>
  
  <p><strong>index.js:</strong></p>
  
  <pre><code>exports.index = function(req,res) {
    res.render('index');
  });
  </code></pre>
  
  <p><strong>pics.js</strong></p>
  
  <pre><code>exports.pics = function(req, res) {
    res.render('pics');
  };
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var routes = require('./routes');
  
  app.get('/', routes.index);
  app.get('/pics', routes.pics);
  </code></pre>
  
  <p>What am I doing wrong in the latter example to break everything?</p>