Changing the Handlebars extension and adding complete code to a view Express.js Handlebars
Hi, I’m learning a lot of new things with Hanldebars templating for Express.js, and I want to share this new things
First of all, we can change the extension .handlebars to .hbs for the layout in this case we need to set the extname: ‘.hbs’ in the engine object
And it will search for the .hbs layout extension
Complete code to a view, for example, if we want to add a complete custom HTML template we need to specify the layout to null
Let’s add our own complete code
Conclusion
These are shortcuts to help you work with Express.js and handlebars and on top of that you can use them as a way to improve your views or layouts.