title: Unable to call jsp pages using ejs and express in node js?
body: <p>Here is my app.js</p>
  
  <pre><code>var express = require('express'),
  app = express();
  var port = process.env.PORT || 8000;.
  var io = require('socket.io').listen(app.listen(port));
  require('./config')(app, io);
  require('./routes')(app, io);
  console.log('Your application is running on http://localhost:' + port);
  </code></pre>
  
  <p>Here is my config.js</p>
  
  <pre><code>var express = require('express');
  module.exports = function(app, io){
  app.set('view engine', 'jsp');
  app.engine('jsp', require('ejs').renderFile);
  app.set('views', __dirname + '/views');
  app.use(express.static(__dirname + '/public'));
  io.set('log level', 1);
  };
  </code></pre>
  
  <p>Here is my routes.js</p>
  
  <pre><code>var gravatar = require('gravatar');
  module.exports = function(app,io){
  
  app.get('/', function(req, res){
  
      res.render('home');
  });
  
  app.get('/create', function(req,res){
  
  
      var id = Math.round((Math.random() * 1000000));
  
      res.redirect('/chatting/'+id);
  });
  
  app.get('/chatting/:id', function(req,res){
  
  
      res.render('chatting');
  
  });
  
  app.get('/iframekapage', function(req,res){
  
  
      res.render('iframekapage');
  });
  
  var chat = io.of('/socket').on('connection', function (socket) {
  
  
  
      socket.on('load',function(data){
  
          if(chat.clients(data).length === 0 ) {
  
              socket.emit('peopleinchat', {number: 0});
          }
          else if(chat.clients(data).length === 1) {
  
              socket.emit('peopleinchat', {
                  number: 1,
                  user: chat.clients(data)[0].username,
                  avatar: chat.clients(data)[0].avatar,
                  id: data
              });
          }
          else if(chat.clients(data).length &gt;= 2) {
  
              chat.emit('tooMany', {boolean: true});
          }
      });
  
      socket.on('login', function(data) {
  
  
          if(chat.clients(data.id).length &lt; 2){
  
  
              socket.username = data.user;
              socket.room = data.id;
              socket.avatar = gravatar.url(data.avatar, {s: '140', r: 'x', d: 'mm'});
  
  
              socket.emit('img', socket.avatar);
  
  
  
              socket.join(data.id);
  
              if(chat.clients(data.id).length == 2) {
  
                  var usernames = [],
                      avatars = [];
  
                  usernames.push(chat.clients(data.id)[0].username);
                  usernames.push(chat.clients(data.id)[1].username);
  
                  avatars.push(chat.clients(data.id)[0].avatar);
                  avatars.push(chat.clients(data.id)[1].avatar);
  
  
  
  
                  chat.in(data.id).emit('startChat', {
                      boolean: true,
                      id: data.id,
                      users: usernames,
                      avatars: avatars
                  });
              }
  
          }
          else {
              socket.emit('tooMany', {boolean: true});
          }
      });
  
  
      socket.on('disconnect', function() {
  
  
          socket.broadcast.to(this.room).emit('leave', {
              boolean: true,
              room: this.room,
              user: this.username,
              avatar: this.avatar
          });
  
  
          socket.leave(socket.room);
      });
  
  
  
      socket.on('msg', function(data){
  
  
          socket.broadcast.to(socket.room).emit('receive', {msg: data.msg, user: data.user, img: data.img});
      });
   });
    };
  </code></pre>
  
  <p>I don't know what problem am I facing, I have changed the <strong>.html</strong> to <strong>.jsp</strong> in <code>config.js</code> but stll it is throwing errors like this:</p>
  
  <pre><code>Error: Failed to lookup view "home" in views directory "C:\Users\admin\Documents\NetBeansProjects\nodejsproject\web/views"
  </code></pre>
  
  <p>I don't know why am I getting these error.</p>
  
  <p>Could this be due to <code>ejs</code> I am using ?</p>