Rendering the views

Let's take a minute to do a quick recap and see what we've done up to this point. So far, we have:

  • Created index.handlebars and image.handlebars—the views for the two main pages of the application
  • Created layouts/main.handelbars—the main layout file for every page in the application
  • Created partials/comments.handlebars, popular.handlebars, and stats.handlebars
  • Created a global timeago Handlebars helper

So far, so good; however, none of these views actually do anything, receive any viewModels, or even appear when you run the application! Let's make a few quick minor modifications to our controllers to get our views to render properly.

Open /controllers/home.js so that you can edit the home controller module. Update the contents of ...

Get Web Development with MongoDB and NodeJS - Second Edition 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.