Which decorator is used to define a controller in NestJS?
@Controller()
@Module()
@Injectable()
@Component()
How do you access the request body in a NestJS controller?
Through the context object
context
Using req.body
req.body
Using the @Body() decorator
@Body()
Accessing request.data
request.data
What is the role of CallHandler in the intercept method of an Interceptor?
CallHandler
intercept
It provides utility methods for transforming the request object.
It handles errors thrown within the Interceptor.
It represents the next Interceptor in the chain or the route handler itself.
It provides access to the dependency injection container.
Which component in NestJS is responsible for handling incoming HTTP requests and routing them to the appropriate handlers?
Module
Provider
Middleware
Controller
What is the purpose of the @Res() decorator in NestJS?
@Res()
To directly interact with the response object
To define a new route
To handle asynchronous operations
To access route parameters
What is the primary function of middleware in NestJS?
To render dynamic views on the server.
To handle database operations.
To intercept and modify incoming requests and outgoing responses.
To define API routes.
Which programming language forms the foundation of NestJS?
JavaScript/TypeScript
Java
Ruby
Python
Which HTTP method does the @Post() decorator handle?
@Post()
PUT
DELETE
GET
POST
What design pattern does NestJS heavily rely on for structuring code?
Dependency Injection
Observer
Factory Method
Singleton