import { Logger, Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { DepartmentService } from './department.service'; import { DepartmentController } from './department.controller'; import { Department } from './entities/department.entity'; @Module({ imports: [TypeOrmModule.forFeature([Department])], controllers: [DepartmentController], providers: [Logger, DepartmentService], // If you want to use the repository outside of the module // which imports TypeOrmModule.forFeature, you'll need to re-export the providers generated by it. // exports: [TypeOrmModule], }) export class DepartmentModule {}