From 2bcde7d3a90e2bfb3aae1262b71c4b698fa77af5 Mon Sep 17 00:00:00 2001 From: hyohyo12 <129946082+hyohyo12@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:55:04 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=B6=A9=EB=8F=8C=20=ED=95=B4=EA=B2=B0?= =?UTF-8?q?=20#88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/app.module.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index e3db7f41..60dc676c 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -12,8 +12,10 @@ import { AuthModule } from './auth/auth.module'; import { UserModule } from './user/user.module'; import { BannerModule } from './banner/banner.module'; import { AdminModule } from './admin/admin.module'; -import { APP_INTERCEPTOR } from '@nestjs/core'; +import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core'; import { TimezoneInterceptor } from './config/TimezoneInterceptor'; +import { StorageModule } from './storage/storage.module'; +import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler'; @Module({ imports: [ @@ -21,6 +23,12 @@ import { TimezoneInterceptor } from './config/TimezoneInterceptor'; TypeOrmModule.forRootAsync({ useClass: TypeOrmConfigService, }), + ThrottlerModule.forRoot([ + { + ttl: 60000, + limit: 3, + }, + ]), AuthModule, UserModule, PlaceModule, @@ -28,6 +36,7 @@ import { TimezoneInterceptor } from './config/TimezoneInterceptor'; CourseModule, BannerModule, AdminModule, + StorageModule, ], controllers: [AppController], providers: [ @@ -36,6 +45,10 @@ import { TimezoneInterceptor } from './config/TimezoneInterceptor'; provide: APP_INTERCEPTOR, useClass: TimezoneInterceptor, }, + { + provide: APP_GUARD, + useClass: ThrottlerGuard, + }, ], }) export class AppModule {}