title: adding a new route to node express
body: <p>I'm trying to add a new route in my express app but I keep getting error when trying to start the server. The error is </p>
  
  <pre><code>C:\development\node\express_app\node_modules\express\lib\router\index.js:252
      throw new Error(msg);
            ^
  Error: .get() requires callback functions but got a [object Undefined]
  </code></pre>
  
  <p>here are my files, I'm new to node so let me know if i left out an important file</p>
  
  <p>routes/furniture.js</p>
  
  <pre><code>exports.furniture = function(req, res){
     res.render('furniture', { title: '4\267pli' });
  };
  </code></pre>
  
  <p>routes/index.js</p>
  
  <pre><code>/*
   * GET home page.
   */
  
  exports.index = function(req, res){
    res.render('index', { title: '4\267pli' });
  };
  </code></pre>
  
  <p>views/furniture.ejs</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;4&amp;middot;pli -- architecture&lt;/title&gt;
      &lt;link rel='stylesheet' href='/stylesheets/style.css'/&gt;
      &lt;link href='http://fonts.googleapis.com/css?family=Didact+Gothic' rel='stylesheet' type='text/css'&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="wrapper"&gt;
      &lt;h1 class="logo"&gt;&lt;%= title %&gt;&lt;/h1&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>/**
   * Module dependencies.
   */
  
  var express = require('express')
    , routes = require('./routes')
    , user = require('./routes/user')
    , furniture = require('./routes/furniture')
    , http = require('http')
    , path = require('path');
  
  var app = express();
  
  // all environments
  app.set('port', process.env.PORT || 3000);
  app.set('views', __dirname + '/views');
  app.set('view engine', 'ejs');
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
    app.use(require('stylus').middleware(__dirname + '/public'));
  app.use(express.static(path.join(__dirname, 'public')));
  
  // development only
  if ('development' == app.get('env')) {
    app.use(express.errorHandler());
  }
  
  app.get('/', routes.index);
  app.get('/users', user.list);
  app.get('/furniture', routes.furniture);
  
  http.createServer(app).listen(app.get('port'), function(){
    console.log('Express server listening on port ' + app.get('port'));
  });
  </code></pre>