What is the role of the app.module.ts file in a NestJS application?
app.module.ts
It defines a specific service for a particular business logic.
It defines a single controller for handling HTTP requests.
It contains the application's main configuration and serves as the root module.
It handles routing logic for different API endpoints.
How would you define a route parameter named 'id' in a NestJS route path?
/users/{id}
/users/:id
/users?id=value
/users/<id>
Which decorator is used to define a custom exception filter in NestJS?
@Module()
@Controller()
@Injectable()
@Catch()
After installing the NestJS CLI, what command is used to initiate a new NestJS project?
nestjs create-app my-app
create-react-app my-nestjs-project
nest new project-name
npm init nestjs-app
Which of the following best describes NestJS?
A database management system for storing application data
A cloud computing platform for deploying and scaling applications
A front-end framework for building user interfaces
A server-side framework for building efficient and scalable applications
What is the purpose of the imports array in a NestJS module definition?
imports
To include providers that are specific to the module.
To import external JavaScript libraries.
To import other modules, making their exported components available within the current module.
To define the routes handled by the module.
How can you define multiple route paths for a single controller method in NestJS?
By using an array of strings as the route path
By defining multiple methods for each path
It's not possible to have multiple paths for one method
By using the @Routes() decorator
@Routes()
Which programming language forms the foundation of NestJS?
Python
Java
Ruby
JavaScript/TypeScript
Which of these features is NOT a primary advantage of using NestJS?
Provides a command-line interface (CLI) for easy project setup
Leverages TypeScript for improved code structure and maintainability
Encourages code organization through modules and providers
Directly renders dynamic user interfaces in the browser
How do you access query parameters in a NestJS controller method?
Using @Headers()
@Headers()
Using @Body()
@Body()
Using @Query()
@Query()
Using @Param()
@Param()