Chapter 5. Understanding requests and responses
This chapter covers
- Understanding the hapi.js request lifecycle
- Using extension points
- Examining the reply interface in depth
- Looking at the response object
- Dealing with handling and communicating errors
I hope by now you’ve gotten a decent feel for hapi.js. You should have picked up useful, practical skills that you can apply in building your own applications. You also should have a good grasp of the language and terms we use in hapi—things like routes, handlers, requests, responses, and so on.
It should be clear that hapi has a lot going on under the surface. How things work and fit together internally is probably still rather unclear to you. We’ve only scratched the outer surface of the framework, superficially picking and choosing a small subset of the features without seeking a profound understanding of the framework. This has been an intentional decision on my part, and I’m hoping it has been a satisfying experience, and you’re hungry for more. Now it’s time to dig a little deeper.