NestJS · Junior · Question 22 of 75

How do you read ?page=2 in a controller?

Explanation

Query values are strings. Convert them with a pipe (ParseIntPipe, DefaultValuePipe) or with ValidationPipe and transform: true.

Further reading

Problem with a question

NestJS · Junior · question 22

Test yourself

Take the NestJS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz