import { Module, ValidationPipe } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { Song } from './song.entity'; import { AlbumModule } from '../album/album.module'; import { SongController } from './song.controller'; import { SongService } from './song.service'; import { APP_PIPE } from '@nestjs/core'; @Module({ imports: [TypeOrmModule.forFeature([Song]), AlbumModule], controllers: [SongController], providers: [ SongService, { provide: APP_PIPE, useValue: new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true, }), }, ], exports: [TypeOrmModule], }) export class SongModule {}