Which decorator is used to define a custom exception filter in NestJS?
@Controller()
@Catch()
@Module()
@Injectable()
How can you define multiple route paths for a single controller method in NestJS?
By using an array of strings as the route path
It's not possible to have multiple paths for one method
By defining multiple methods for each path
By using the @Routes() decorator
@Routes()
How do you access the request body in a NestJS controller?
Accessing request.data
request.data
Using req.body
req.body
Through the context object
context
Using the @Body() decorator
@Body()
After installing the NestJS CLI, what command is used to initiate a new NestJS project?
nest new project-name
nestjs create-app my-app
npm init nestjs-app
create-react-app my-nestjs-project
What is the purpose of the @Module() decorator?
To define a unit test case.
To define a module, which acts as a container for other NestJS components.
To define a route handler for a specific HTTP method.
To mark a class as a database entity.
What is a potential drawback of using singleton providers excessively in a large application?
Slower application startup time.
All of the above.
Difficulty in testing individual components.
Increased memory usage due to persistent instances.
Which HTTP method does the @Post() decorator handle?
@Post()
PUT
POST
DELETE
GET
What is the purpose of the @Body() decorator?
Accesses the request headers
Accesses query parameters
Accesses route parameters
Accesses the entire request body
How do you access query parameters in a NestJS controller method?
Using @Query()
@Query()
Using @Headers()
@Headers()
Using @Body()
Using @Param()
@Param()
How would you define a route parameter named 'id' in a NestJS route path?
/users?id=value
/users/{id}
/users/:id
/users/<id>