4
Exploring Hooks
In this chapter, we will learn what makes Fastify different from the majority of other web frameworks. In fact, contrary to several other frameworks that have the concept of middleware, Fastify is based on hooks. They all have different use cases, and mastering their usage is key to developing stable and production-ready server applications.
Even if the topic is considered somehow complex, the goal of the subsequent sections is to give a good overview of how the Fastify framework “thinks” and build the right confidence in using these tools.
Before going into their details, though, we need to introduce another concept that makes everything even possible. Namely, we need to learn about the lifecycle of Fastify applications.
Get Accelerating Server-Side Development with Fastify 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.