Question · NestJS course · Module 1: NestJS Basics

@Param Decorator

What is the @Param() decorator used for in a NestJS controller?

Answer options

  • For extracting data from the HTTP request body
  • For extracting parameters from the URL (e.g., /legionaries/1)
  • For setting response headers
  • For defining the database schema
Show the answer

Correct answer:

  • For extracting parameters from the URL (e.g., /legionaries/1)