opened
Poline
username_0
Help me please
Here is my app.js
var express = require('express');
var http = require('http');
var path = require('path');
var config = require('config');
var log = require('libs/log')(module);
var app = express();
app.engine('ejs', require('ejs-locals')); 
app.set('views', __dirname + '/templates');
app.set('view engine', 'ejs'); 
app.use(express.favicon());
if(app.get('env') == 'development') {
    app.use(express.logger('dev'));
} else{
    app.use(express.logget('default'));
}
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(app.router);
app.get('/', function(req, res, next){
    res.render("index",{
        body: '<b>Hello</b>'
    });
});
app.use(express.static(path.join(__dirname + 'public')));
app.use(function(err, req, res, next){
    if (app.get('env') == 'development'){
        var errorHandler = express.errorHandler();
        errorHandler(err, req, res, next);
    } else{
        res.send(500);
    }
});
http.createServer(app).listen(config.get('port'), function(){
  log.info('Express server listening on port ' + config.get('port'));
});

This is the error
Express
500 Error: Failed to lookup view "index"
at Function.app.render (d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\node_modules\express\lib\application.js:495:17)
at ServerResponse.res.render (d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\node_modules\express\lib\response.js:760:7)
at d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\app.js:36:9
at callbacks (d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\node_modules\express\lib\router\index.js:164:37)
at param (d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\node_modules\express\lib\router\index.js:138:11)
at pass (d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\node_modules\express\lib\router\index.js:145:5)
at Router._dispatch (d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\node_modules\express\lib\router\index.js:173:5)
at Object.router (d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\node_modules\express\lib\router\index.js:33:10)
at next (d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\node_modules\express\node_modules\connect\lib\proto.js:190:15)
at Object.cookieParser [as handle] (d:\Пользователи\Polina\Documents\Универ\2й курс\2й семестр\АИС\registrationform\node_modules\express\node_modules\connect\lib\middleware\cookieParser.js:60:5)
Express 500 Error: Failed to lookup view "index"
issue
closed
zappan
username_1
issue
created
zappan
username_1
don't see an issue report here. closing as invalid.
comment