Lifecycle

Following the schema of the internal lifecycle of Fastify.
On the right branch of every section there is the next phase of the lifecycle, on the left branch there is the corresponding error code that will be generated if the parent throws an error (note that all the errors are automatically handled by Fastify).

  1. Incoming Request
  2. └─▶ Routing
  3. └─▶ Instance Logger
  4. 4**/5** ◀─┴─▶ onRequest Hook
  5. 4**/5** ◀─┴─▶ preParsing Hook
  6. 4**/5** ◀─┴─▶ Parsing
  7. 4**/5** ◀─┴─▶ preValidation Hook
  8. 415 ◀─┴─▶ Validation
  9. 4**/5** ◀─┴─▶ preHandler Hook
  10. 4**/5** ◀─┴─▶ User Handler
  11. └─▶ Reply
  12. 4**/5** ◀─┴─▶ preSerialization Hook
  13. └─▶ onSend Hook
  14. 4**/5** ◀─┴─▶ Outgoing Response
  15. └─▶ onResponse Hook