One search. Connected ideas.
Find the lesson, understand the concept, and prepare your answer.
8 results shown · grouped by type
Lessons3
The request lifecycle is the order in which Nest processes an incoming request and produces a response. Different extension points handle different concerns, such as access checks, input conversion and response wrapping. Knowing the order helps explain why code in one stage cannot rely on work that happens later.
Nest can attach request handlers at global, controller and route scopes. Scope determines which requests a handler applies to, while handler type determines execution order. Interceptors wrap inner work and unwind on the response path; exception filters select a matching handler rather than form a normal middleware chain.
Guards, pipes, interceptors and filters are separate request extension points with different jobs. A guard decides whether work may proceed; a pipe validates or transforms arguments; an interceptor wraps execution; a filter handles uncaught errors. Choosing the correct point avoids mixing authentication, validation and formatting into business methods.
Interview questions4
The request lifecycle is the order in which Nest processes an incoming request and produces a response. Different extension points handle different concerns, such as access checks, input conversion and response wrapping. Knowing the order helps explain why code in one stage cannot rely on work that happens later.
Nest can attach request handlers at global, controller and route scopes. Scope determines which requests a handler applies to, while handler type determines execution order. Interceptors wrap inner work and unwind on the response path; exception filters select a matching handler rather than form a normal middleware chain.
Guards, pipes, interceptors and filters are separate request extension points with different jobs. A guard decides whether work may proceed; a pipe validates or transforms arguments; an interceptor wraps execution; a filter handles uncaught errors. Choosing the correct point avoids mixing authentication, validation and formatting into business methods.
A provider is a dependency that Nest can supply, such as a class instance, value or factory result. Custom providers control how that dependency is created, and scope controls how long its instances are shared. These choices affect testability, state isolation and allocation cost.
Modules1
NestJS learning module