Express templating
Each of our route handlers are currently logging very simple messages to the browser. In a real-world application, however, we will need to render complete HTML pages. These pages would have a standard HTML structure, use CSS style sheets, and depending on the creativity of the design team, could easily become very complex. To support the complexity of generating HTML pages, most frameworks provide a templating engine.
Express also provides a complete template framework, which can use a choice of different template engines, including Pug, Mustache, Jade, Dust, and Embedded JavaScript templates (EJS) to name a few. Introducing a template engine within our Express application is as simple as installing the template engine ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access