Chapter 3. Templating

We have our Web API in place, so let's turn our attention to the client. In this chapter, we will consume our Web API and present our data using a mixture of both server-side and client-side templating. We will serve a./views/index.html masterpage file from the server with Express and use consolidate.js and handlebars.js for templating. On the client side we will use backbone.js and precompiled handlebars templates served directly out of the ./public folder.

Server-side templating

Up until now our Express server has only served JSON; let's install a couple of modules that will assist us in serving HTML.

consolidate.js is a template engine consolidation library that was created to map all of Node's popular templating engines ...

Get Advanced Express Web Application Development 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.