mirror of
https://github.com/zen-browser/rices.git
synced 2025-07-08 09:20:08 +02:00
first commit
This commit is contained in:
commit
232d8b37d6
36 changed files with 11302 additions and 0 deletions
31
src/app.module.ts
Normal file
31
src/app.module.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { GitHubModule } from './github/github.module';
|
||||
import { RicesModule } from './rices/rices.module';
|
||||
import { ThrottlerExceptionFilter } from './common/filters/throttler-exception.filter';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
}),
|
||||
ThrottlerModule.forRoot([
|
||||
{
|
||||
ttl: 60000,
|
||||
limit: 10,
|
||||
},
|
||||
]),
|
||||
GitHubModule,
|
||||
RicesModule,
|
||||
],
|
||||
controllers: [],
|
||||
providers: [
|
||||
{
|
||||
provide: APP_GUARD,
|
||||
useClass: ThrottlerGuard,
|
||||
},
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
Loading…
Add table
Add a link
Reference in a new issue