import { Module } from '@nestjs/common' import { ConfigService } from '@nestjs/config' import { ThrottlerModule as NestThrottlerModule } from '@nestjs/throttler' @Module({ imports: [ NestThrottlerModule.forRootAsync({ inject: [ConfigService], useFactory: (config: ConfigService) => ({ throttlers: [ { ttl: config.getOrThrow('THROTTLE_TTL'), limit: config.getOrThrow('THROTTLE_LIMIT'), }, ], }), }), ], }) export class ThrottlerModule {}