How to solve the views directory errors in hbs library for express || Tw...

How to solve the views directory errors in hbs library for express 


Express 4.0 Failed to Look up view in “/views” directory

Here is the configuration app.set('views', path.join(__dirname, 'views/')); app.engine('hbs', hbs({defaultLayout: 'main', extname: '.hbs'})); app.set('view engine', 'hbs'); The contact.html is in the views directory app.get('/', function(req, res) { res.render("contact"); }); This is the error i get : Error: Failed to lookup view "contact" in views directory "/Users/max23/

Post a Comment

0 Comments