Nest applications handle requests and produce responses in a sequence we refer to as the request lifecycle. With the use of middleware, pipes, guards, and interceptors, it can be challenging to track down where a particular piece of code executes during the request lifecycle, especially as global, controller level, and route level components come into play. In general, a request flows through middleware to guards, then to interceptors, then to pipes and finally back to interceptors on the return path (as the response is generated).
Request lifecycle
- Middleware
- Guards
- Pre Interceptors
- Pipes
- Controller
- Service
- Post Interceptors
- Filters
Read more details at there