Bird
0
0

Which of the following is true about guard binding levels in NestJS?

easy📝 Conceptual Q11 of 15
NestJS - Guards
Which of the following is true about guard binding levels in NestJS?
ARoute guards apply to all controllers automatically.
BGlobal guards apply to all routes in the application.
CController guards cannot be overridden by route guards.
DGuards can only be applied globally, not to specific routes.
Step-by-Step Solution
Solution:
  1. Step 1: Understand global guard scope

    Global guards are set once and protect every request in the app.
  2. Step 2: Compare with other guard levels

    Route guards apply only to specific routes, and controller guards apply to all routes in a controller. Route guards can override controller guards.
  3. Final Answer:

    Global guards apply to all routes in the application. -> Option B
  4. Quick Check:

    Global guard = all routes [OK]
Quick Trick: Global guards protect all routes, no exceptions [OK]
Common Mistakes:
  • Thinking route guards apply globally
  • Believing controller guards cannot be overridden
  • Assuming guards can't be applied to routes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes