Scenario: I had developed some transactional pages using Node.js, Express + Handlebars as view engine and MongoDB.
Now the issue is during module integration I got some of the pages which are built on Express + Jade as view engine.
Question: How to integrate pages built on Handlebars & some on Jade?
Is a View Engine necessary for Express/Node? No, it is not required. Express can happily serve static HTML5 files as you wish. You don't need a view engine for that.
Koa, React, Flask, Django, and Golang are the most popular alternatives and competitors to ExpressJS.
Two common full-stack JavaScript stacks are: MEAN stack - MongoDB (database), Express (server), Angular (front-end framework), and Node (runtime environment)
In yourapp.js
var engines = require('consolidate');
app.engine('jade', engines.jade);
app.engine('handlebars', engines.handlebars);
More info here
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