Use Template Engines with Express

Share this video with your friends

Send Tweet

Template engines allow you to define your UIs in a declarative manner while maintaining a dynamic, data driven presentation layer. This lesson will demonstrate how to use template engines that have built-in support for Express as well as engines without explicit Express support.

Brian
~ 7 years ago

Got errors saying that there was no jade module. On the express site (https://expressjs.com/en/guide/using-template-engines.html), I found that jade has been renamed Pug and that I can get the template engine by installing the npm package: $ npm install pug --save Then I could use it by using pug app.('view engine', 'pug') and changing the templates to *.pug

Emily
~ 4 years ago

Got errors saying that there was no jade module. On the express site (https://expressjs.com/en/guide/using-template-engines.html), I found that jade has been renamed Pug and that I can get the template engine by installing the npm package: $ npm install pug --save Then I could use it by using pug app.('view engine', 'pug') and changing the templates to *.pug

Thank you. I ran into this issue and was able to solve it using your fix.