28 lines
676 B
TypeScript
28 lines
676 B
TypeScript
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';
|
|
|
|
@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 {}
|