NestJS · Junior · Question 9 of 75
What does the @Module() decorator describe?
@Module({
imports: [DatabaseModule],
controllers: [UsersController],
providers: [UsersService],
exports: [UsersService],
})
export class UsersModule {}- 1The database tables of the module
- 2The URL prefix of all routes
- ✓Correct answer: Which modules it imports, which controllers and providers it owns, and which providers it exports to others
Explanation
Modules are the unit of organization in Nest. Every app has at least one root module, usually AppModule.