Chapter 5. Dynamic HTML with Handlebars

One of the most important features when creating a website is the ability to display dynamic content on an HTML page. The difference between dynamic content and static content is that dynamic content is typically generated via conditional statements and/or varying data (usually retrieved from a database). In order to generate parts of an HTML page during runtime, you will need some sort of rendering engine. There are many different rendering engines available that can be used with Node and Express. The particular engine we chose for this book is Handlebars.js—named for the syntax use of {{ and }} that resembles a handlebar mustache!

Basic syntax for Handlebars

The basic syntax for Handlebars is really quite ...

Get Web Development with MongoDB and Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.