flâneur — a map of the web's best reading

Hooks | Fastify

fastify.dev · 5,075 words · saved by 1 readers

Hooks

Version: latest (v5.10.x) On this page Hooks ​ Hooks are registered with the fastify.addHook method and allow you to listen to specific events in the application or request/response lifecycle. You have to register a hook before the event is triggered, otherwise, the event is lost. By using hooks you can interact directly with the lifecycle of Fastify. There are Request/Reply hooks and application hooks: Request/Reply Hooks onRequest preParsing preValidation preHandler preSerialization onError onSend onResponse onTimeout onRequestAbort Manage Errors from a hook Respond to a request from a hook

Explore this link on the map →

related reading