NestJS · Junior · Question 19 of 75

What happens if a controller method returns a plain object?

Explanation

Returning a value (or a promise) is the standard approach. Injecting the platform response with @Res() switches you to manual mode, where you must send the response yourself.

Further reading

Problem with a question

NestJS · Junior · question 19

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