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:
parent
25d69823fa
commit
b95f5be3a6
20
src/app.module.ts
Normal file
20
src/app.module.ts
Normal 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 {}
|
Loading…
x
Reference in New Issue
Block a user