Which decorator is used to define a basic GET route in NestJS?
@Route()
@Path()
@Get()
@Post()
What are the building blocks of a NestJS application called?
Components
Services
Controllers
Modules
How can you define multiple route paths for a single controller method in NestJS?
By defining multiple methods for each path
By using an array of strings as the route path
By using the @Routes() decorator
@Routes()
It's not possible to have multiple paths for one method
What is the advantage of using built-in HTTP exception filters in NestJS?
They are primarily used for handling authentication and authorization errors.
They are only applicable for database-related exceptions.
They allow you to bypass the need for exception handling altogether.
They provide a streamlined way to handle common HTTP errors with predefined responses.
How does Dependency Injection work in NestJS?
Dependencies are fetched from a global configuration file.
NestJS automatically resolves and injects dependencies based on constructor parameters.
Dependency Injection is not supported in NestJS.
Dependencies are manually created and passed around.
After installing the NestJS CLI, what command is used to initiate a new NestJS project?
nest new project-name
create-react-app my-nestjs-project
nestjs create-app my-app
npm init nestjs-app
What is the primary function of middleware in NestJS?
To handle database operations.
To define API routes.
To render dynamic views on the server.
To intercept and modify incoming requests and outgoing responses.
How do you access the request body in a NestJS controller?
Through the context object
context
Using the @Body() decorator
@Body()
Using req.body
req.body
Accessing request.data
request.data
What is the purpose of the @Get() decorator in NestJS?
Handles POST requests
Handles GET requests
Handles PUT requests
Handles DELETE requests
Which decorator is associated with removing resources in RESTful APIs?
@Put()
@Delete()