NestJS · Junior · Question 16 of 75
Which route does this handler serve?
@Controller("users")
export class UsersController {
@Get(":id")
findOne(@Param("id") id: string) {}
}- ✓Correct answer:
GET /users/:id - 2
POST /users - 3
GET /:id/users
Explanation
The controller prefix and the method path are joined. With app.setGlobalPrefix('api') it becomes /api/users/:id.