okey so im trying to get handlebars to workand so ive been following this youtube guide: https://www.youtube.com/watch?v=SfQFoMOd_ng
and my problem is that the code on row 15 gets an error:
Error: ENOENT: no such file or directory, open 'C:\Users\9826skma\Desktop\Lol stats\playground\test handlebars\views\layouts\main.handlebars'
server.js file
ive used
npm i express --save, npm i express-handlebars --save in powershell
You can also add defaultLayout: null. So for example ...
app.engine('.hbs', exphbs({
extname: '.hbs',
defaultLayout: null
}));
Your folder is called layout
, but the code is looking for layouts
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With