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.
This commit is contained in:
Mathis H (Avnyr) 2024-07-09 13:42:41 +02:00
parent 25d69823fa
commit b95f5be3a6
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

20
src/app.module.ts Normal file
View File

@ -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 {}