title: Displaying views in Node.js/Express
body: <p>I am following the peepcode (part 1) video tutorial on node.js, and I am getting stuck on the first few steps. When I try to go to <code>http://localhost:3000/login</code>, I get the following error:</p>
  
  <p><em>500 Error: Failed to lookup view "/Users/dantang/Desktop/Programming/Node/basic server/hotpie/apps/authentication/views/login"</em></p>
  
  <p>I'm guessing it is due to a typo, but I've tried changing the code several times and I can't figure out what is wrong. Would really appreciate it if someone could tell me what should I do? Thank you!</p>
  
  <p>The github repo is <a href="https://github.com/tangbj/nodejs" rel="nofollow">https://github.com/tangbj/nodejs</a></p>
  
  <p>Server.js</p>
  
  <pre><code>/**
   * Module dependencies.
   */
  
  require("coffee-script");
  
  var express = require('express')
    , http = require('http')
    , path = require('path');
  
  var app = express();
  
  app.configure(function(){
    app.set('port', process.env.PORT || 3000);
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.favicon());
    app.use(express.logger('dev'));
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(express.static(path.join(__dirname, 'public')));
  });
  
  app.configure('development', function(){
    app.use(express.errorHandler());
  });
  
  
  //Routes
  require('./apps/authentication/routes')(app);
  
  
  http.createServer(app).listen(app.get('port'), function(){
    console.log("Express server listening on port " + app.get('port'));
  });
  </code></pre>
  
  <p>login.jade</p>
  
  <pre><code>form(action='/sessions', method='post')
    label
      | Username
      input(type='text', name='user')
    label
      | Password
      input(type='password', name='password')
    input(type='submit', name='Submit')
  </code></pre>
  
  <p>routes.coffee</p>
  
  <pre><code>routes = (app) -&gt;
  
    app.get '/login', (req, res) -&gt;
      res.render "#{__dirname}/views/login",
        title: 'Login'
        stylesheet: 'login'
  
  module.exports = routes
  </code></pre>
  
  <p>package.json</p>
  
  <pre><code>{
    "name": "application-name",
    "version": "0.0.1",
    "private": true,
    "dependencies": {
      "express": "3.1.0",
      "jade": "*",
      "coffee-script": "~1.6.1"
    }
  }
  </code></pre>