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

Building a Route with a Parameter

Arrange the elements of a GET route with a parameter in the correct order:

Items to click

  • getTributeById(
  • { return this.service.findById(id); }
  • @Param('id') id: string)
  • @Get(':id')
Show the answer

Correct order:

  1. @Get(':id')
  2. getTributeById(
  3. @Param('id') id: string)
  4. { return this.service.findById(id); }