From b95f5be3a60db5d03d5bd9756d9a29a02637c5d9 Mon Sep 17 00:00:00 2001 From: Mathis Date: Tue, 9 Jul 2024 13:42:41 +0200 Subject: [PATCH] feat(app.module): add ThrottlerModule and ConfigModule A new app.module.ts file was added with ThrottlerModule and ConfigModule imported from NestJS. The throttler is configured with a rate limit and the configuration module is set as global. The LogService was provided and exported for other parts of the application to use. --- src/app.module.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/app.module.ts diff --git a/src/app.module.ts b/src/app.module.ts new file mode 100644 index 0000000..bb41419 --- /dev/null +++ b/src/app.module.ts @@ -0,0 +1,20 @@ +import { Module } from "@nestjs/common"; +import { ConfigModule } from "@nestjs/config"; +import { LogService } from "./logger/logger.service"; +import { ThrottlerModule } from "@nestjs/throttler"; + +@Module({ + imports: [ + ThrottlerModule.forRoot([{ + ttl: 60000, + limit: 10, + }]), + ConfigModule.forRoot({ + isGlobal: true + }) + ], + exports: [LogService], + controllers: [], + providers: [LogService], +}) +export class AppModule {}