codejump

Routes & Decorators

Preview — 3 of 10 questions

You want a class to handle incoming HTTP requests for the path /users. Which decorator turns the class into a controller and registers that path prefix?

A@Injectable('users')
B@Route('users')
C@Module('users')
D@Controller('users')

Which decorator maps a handler method to an HTTP POST request?

A@Create()
B@HttpPost()
C@Method('POST')
D@Post()

Given a route GET /users/:id, how do you read the id segment inside the handler?

A@Param('id') id: string
B@Body('id') id: string
C@Query('id') id: string
D@Header('id') id: string

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.