Complete the code to import the core NestJS module decorator.
import { [1] } from '@nestjs/common';
The @Module decorator is used to define a NestJS module like AppModule.
Complete the code to define the root module class named AppModule.
@Module({})
export class [1] {}The root module class is conventionally named AppModule in NestJS projects.
Fix the error in the module decorator to include an empty imports array.
@Module({ imports: [1] })
export class AppModule {}The imports property expects an array, even if empty, to list imported modules.
Fill both blanks to add a controller and a provider to the module metadata.
@Module({
controllers: [[1]],
providers: [[2]]
})
export class AppModule {}The controllers array lists controllers like AppController, and providers lists services like AppService.
Fill all three blanks to import a module, add a controller, and add a provider in AppModule.
import { Module } from '@nestjs/common'; import { [1] } from './cats/cats.module'; import { [2] } from './cats/cats.controller'; import { [3] } from './cats/cats.service'; @Module({ imports: [[1]], controllers: [[2]], providers: [[3]] }) export class AppModule {}
To organize features, import CatsModule, add CatsController to controllers, and CatsService to providers.