Question · NestJS course · Module 1: NestJS Basics

@Get Decorator with a Parameter

How do you extract a URL parameter in a NestJS controller (e.g., /legion/5)?

Answer options

  • @Query('id') id: string
  • @Body('id') id: string
  • @Header('id') id: string
  • @Param('id') id: string
Show the answer

Correct answer:

  • @Param('id') id: string