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:
- @Get(':id')
- getTributeById(
- @Param('id') id: string)
- { return this.service.findById(id); }