Converting Express 2.x app to Express 3.0 app
I'm currently learning NodeJs and Express am trying to convert a tutorial app from Express 2.5.9 to 3.0. The code below now throws the error "500 Error: Failed to lookup view "views/login". What is the 3.0 way of getting this to render now?
apps authentication views login.jade routes.coffee ... server.js
And in routes.coffee
routes = (app) -> app.get '/login', (req, res) -> res.render "views/login", title: 'Login' stylesheet: 'login' module.exports = routes
To find out what directory express is using to find your views you need to check the following setting of your view engine:
app.set('views', __dirname + '/some-dir');
This is something that didn't change in 3.x. If you need further help migrating the following guide might be useful: