O'Reilly logo

Web Development with MongoDB and NodeJS - Second Edition by Jason Krol, Bruno Joseph D'mello, Mithun Satheesh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required