NestJS · Junior · Pytanie 16 z 75
Jaką trasę obsługuje ten handler?
@Controller("users")
export class UsersController {
@Get(":id")
findOne(@Param("id") id: string) {}
}- ✓Poprawna odpowiedź:
GET /users/:id - 2
POST /users - 3
GET /:id/users
Wyjaśnienie
Prefiks kontrolera i ścieżka metody są łączone. Z app.setGlobalPrefix('api') będzie to /api/users/:id.