O'Reilly logo

hapi.js in Action by Matt Harrison

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

Chapter 4. Routes and handlers in-depth

This chapter covers

  • More routing techniques
  • Server methods and prerequisites
  • Creating custom handlers
  • Uploading files

In this chapter we’ll take an in-depth look at two of the most important concepts in hapi: routes and handlers. Routes are how you tell hapi what kind of requests you’re interested in. Handlers are how you choose to respond to those routes. Having a mastery of these two will greatly broaden the types of applications you can create with hapi.

4.1. Routing in-depth

You should be familiar now with what routes are in hapi and how to create them (using server.route()). If you’ve been following along with the example projects in earlier chapters, you will have even made quite a few routes ...

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