Request Lifecycle
Requests in the Angel3 framework go through a relatively complex lifecycle, and to truly master the framework, one must understand that lifecycle.
- 1.
startServer
is called. - 2.Each
HttpRequest
is sent throughhandleRequest
. - 3.
handleRequest
converts theHttpRequest
to aRequestContext
, and converts itsHttpResponse
into aResponseContext
. - 4.
angel3_route
is used to match the request path to a list of request handlers. - 5.Each handler is executed.
- 6.If the response is using streaming, and not buffering content, skip to step 8 (default).
- 7.All
responseFinalizers
are run. - 8.If
res.isDetached == false
, all headers, the status code and the response buffer are sent through the actualHttpResponse
. - 9.The
HttpResponse
is closed.
Last modified 1yr ago