Chapter 1. Introducing hapi


This chapter covers

  • What hapi.js is
  • The problem hapi.js solves
  • The philosophy behind hapi.js
  • The architecture of hapi.js

If you’ve built web applications, in any language or platform, you’ll know that what sometimes starts out as a simple vision can quickly become complicated. There are numerous things to consider when building a web app, including how to go about caching, validating, and authenticating. You also need to decide how to structure your code into files and directories in a way that makes sense.

The decisions one needs to make up front are often difficult and can become overwhelming, even for experienced developers. This is one of the reasons we use frameworks rather than start from scratch every time.

There are many frameworks for building web applications with Node.js. The more minimal ones like Express.js offer relatively little out of the box, with the aim of flexibility, and still require you to make a lot of decisions about infrastructure. Other, more focused API-only frameworks like Restify are limited in their scope of applications.

1.1. What is hapi?

1.2. The building blocks of hapi

1.3. When you should (and shouldn’t) use hapi

1.4. How it works

1.5. Getting help

1.6. Summary