title: Error: Failed to lookup view
body: <p>Iam getting following error if I try to open the localhost:3000 or localhost:3000/login. Can someone help me what is the problem? It is very strange. Many thanks </p>
  
  <p><strong>My Code</strong></p>
  
  <pre><code>var express = require('express');
  var crypto = require('crypto');
  var bodyParser = require('body-parser');
  var flash    = require('connect-flash');
  var cookieParser = require('cookie-parser');
  var session      = require('express-session');
  var path = require ('path');
  var port = process.env.PORT || 3000;
  
  
  var MongoClient = require('mongodb').MongoClient,
      ObjectID = require('mongodb').ObjectID, 
      url = require('url');
  
  var db;
  //var mongo;
  
  //var collection;
  //dataExt = require('./routes/serverExtend');
  // setup middleware
  var app = express();
  app.use(bodyParser());
  app.use(flash());
  app.use(cookieParser('secret'));
  app.use(session({cookie: { secret: 'keyboard cat', maxAge: 60000 }}));
  
  
  app.use(express.static(__dirname + 'public')); //setup static public directory
  
  app.set('views', __dirname + 'testapp/views'); //optional since express defaults to CWD/views
  app.set('view engine', 'ejs');
  
  // Start server
  app.listen(port);
  console.log('App started on port ' + port);
  
  
  // Initialize connection once
  MongoClient.connect("mongodb://localhost:27017/testDB", function(err, database) { //"mongodb://localhost:27017/test"
    if(err) throw err;
  
   db = database;
  
  });
  
  
  
  
  app.get('/', function(req, res) {
      res.render('index.ejs', { message: req.flash('signupMessage')}); // load the index.ejs file
  
  app.get('/login', function(req, res) {
      res.render('login.ejs');
  });
  </code></pre>
  
  <p><strong>Here is my package.json</strong></p>
  
  <pre><code>{
      "name": "NodejsStarterApp",
      "version": "0.0.1",
      "description": "A sample nodejs"
      "dependencies": {
          "express" : "~4.0.0",           
          "ejs" : "*",    
          "mongodb":"*", 
          "connect-flash" : "~0.1.1",
          "morgan": "~1.0.0",
              "body-parser": "*",
              "cookie-parser": "~1.0.0",
              "express-session": "~1.0.0"
  
  
      },
      "engines": {
          "node": "0.10.26"
      },
      "repository": {}
  }
  </code></pre>