Which decorator is used to apply middleware to a specific route in NestJS?
@ApplyMiddleware()
@Route()
@Middleware()
@UseMiddleware()
Which of the following is NOT a valid HTTP method for defining routes in NestJS?
PATCH
DELETE
RENDER
PUT
What is the purpose of the return statement in a NestJS controller method?
return
To send the response to the client
To specify middleware for the route
To handle errors within the route
To define the route path
What is NOT a benefit of using Dependency Injection in NestJS?
Improved code testability.
Increased code coupling.
Better maintainability of code.
Enhanced code reusability.
What is the primary programming language used for developing NestJS applications?
C#
Java
Python
JavaScript
What is a potential drawback of using singleton providers excessively in a large application?
All of the above.
Increased memory usage due to persistent instances.
Slower application startup time.
Difficulty in testing individual components.
In a typical NestJS project structure, which directory commonly houses the application's source code?
/public
/dist
/src
/node_modules
What is the purpose of the @Res() decorator in NestJS?
@Res()
To handle asynchronous operations
To access route parameters
To directly interact with the response object
To define a new route
What is the purpose of the @Module() decorator?
@Module()
To define a unit test case.
To define a route handler for a specific HTTP method.
To mark a class as a database entity.
To define a module, which acts as a container for other NestJS components.
After installing the NestJS CLI, what command is used to initiate a new NestJS project?
nestjs create-app my-app
nest new project-name
npm init nestjs-app
create-react-app my-nestjs-project