UNPKG

2.09 kBMarkdownView Raw
1<h1 align="center">Fastify</h1>
2
3## Lifecycle
4Following the schema of the internal lifecycle of Fastify.<br>
5On 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)*.
6```
7Incoming Request
8
9 └─▶ Routing
10
11 └─▶ Instance Logger
12
13 404 ◀─┴─▶ onRequest Hook
14
15 4**/5** ◀─┴─▶ run Middlewares
16
17 4**/5** ◀─┴─▶ preParsing Hook
18
19 4**/5** ◀─┴─▶ Parsing
20
21 4**/5** ◀─┴─▶ preValidation Hook
22
23 415 ◀─┴─▶ Validation
24
25 400 ◀─┴─▶ preHandler Hook
26
27 4**/5** ◀─┴─▶ User Handler
28
29 └─▶ Reply
30
31 4**/5** ◀─┴─▶ preSerialization Hook
32
33 └─▶ onSend Hook
34
35 4**/5** ◀─┴─▶ Outgoing Response
36
37 └─▶ onResponse Hook
38```