Put in order · NestJS course · Module 2: Routing and Request Lifecycle

Interceptor Execution Phases

Order the execution phases of an interceptor in NestJS:

Items to put in order

  • Logic before passing the request (before)
  • Executing the route handler (next.handle())
  • Calling the intercept() method
  • Response processing (after)
Show the answer

Correct order:

  1. Calling the intercept() method
  2. Logic before passing the request (before)
  3. Executing the route handler (next.handle())
  4. Response processing (after)