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).
Incoming Request
│
└─▶ Routing
│
└─▶ Instance Logger
│
404 ◀─┴─▶ onRequest Hook
│
4**/5** ◀─┴─▶ run Middlewares
│
4**/5** ◀─┴─▶ preParsing Hook
│
4**/5** ◀─┴─▶ Parsing
│
4**/5** ◀─┴─▶ preValidation Hook
│
415 ◀─┴─▶ Validation
│
400 ◀─┴─▶ preHandler Hook
│
4**/5** ◀─┴─▶ User Handler
│
└─▶ Reply
│
4**/5** ◀─┴─▶ preSerialization Hook
│
└─▶ onSend Hook
│
4**/5** ◀─┴─▶ Outgoing Response
│
└─▶ onResponse Hook
当前内容版权归 fastify.io 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 fastify.io .