Skip to content Skip to sidebar Skip to footer

500 Error: Failed To Lookup View "index" In Views Directory

I picked up a book on Web Development with MongoDB and Node.js. I've come to a point where my code is not working and I feel like I have everything correct judging by what the book

Solution 1:

Try doing this in your server.js file

app.set('views', path.join(__dirname, 'views'));

Solution 2:

Well that's embarrassing. I was typing "index.handlebars" to save my files. But, they weren't saving them as HANDLEBARS files, they were getting saved as html documents still some how. I changed all the files to the proper file type and all is working now... Not sure why they weren't getting saved properly at the beginning, could have sworn I had it set up correctly XD thanks for everyone that viewed this.

Post a Comment for "500 Error: Failed To Lookup View "index" In Views Directory"