Chapter 3. Building a website

This chapter covers

  • Serving static content
  • Serving dynamic HTML with views
  • Working with external HTTP APIs from hapi.js
  • Managing user state with sessions

This chapter follows the building of a simple website to show off some of the front-end features in hapi.js. The website we’ll be creating builds on top of the API project from the previous chapter. It will retrieve data from the API and create dynamic web pages using this data.

Don’t worry if you haven’t followed along with the API project in chapter 2. The finished API has been released as an npm package called dindin-api, which we’ll use as a dependency in this chapter.

npm Package

dindin-api (http://npmjs.com/package/dindin-api)

Get hapi.js in Action 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.