app.module.ts•1.3 kB
import { Module } from '@nestjs/common';
import { APP_GUARD, Reflector } from '@nestjs/core';
import { ThrottlerGuard } from '@nestjs/throttler';
import { ConfigModule } from './config/config.module.js';
import { CleanupModule } from './common/cleanup/cleanup.module.js';
import { ThrottlerModule } from '@nestjs/throttler';
import { ScheduleModule } from '@nestjs/schedule';
import { GatewayModule } from './src/modules/gateway.module.js';
import { FileIngestionModule } from './src/modules/file-ingestion.module.js';
import { WorkersModule } from './src/modules/workers.module.js';
@Module({
imports: [
ScheduleModule.forRoot(),
ConfigModule,
GatewayModule,
FileIngestionModule,
WorkersModule,
CleanupModule,
ThrottlerModule.forRoot({
throttlers: [
{
ttl: 60000,
limit: 100,
},
],
}),
],
providers: [
Reflector,
{
provide: APP_GUARD,
useClass: ThrottlerGuard,
},
// TODO add interceptor for agent response
// {
// provide: APP_INTERCEPTOR,
// useClass: AgentResponseInterceptor,
// },
// TODO add interceptor for agent response
// {
// provide: APP_INTERCEPTOR,
// useClass: AgentResponseInterceptor,
// },
],
})
export class AppModule {}