-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.module.ts
More file actions
76 lines (75 loc) · 2.4 KB
/
Copy pathapp.module.ts
File metadata and controls
76 lines (75 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { Module } from "@nestjs/common";
import { ConfigModule, ConfigService } from "@nestjs/config";
import { APP_GUARD } from "@nestjs/core";
import { ScheduleModule } from "@nestjs/schedule";
import { ThrottlerGuard, ThrottlerModule } from "@nestjs/throttler";
import { AuditModule } from "@/audit/audit.module";
import { AzureModule } from "@/azure/azure.module";
import { ApiKeyModule } from "./api-key/api-key.module";
import { AuthModule } from "./auth/auth.module";
import { BenchmarkModule } from "./benchmark/benchmark.module";
import { BlobStorageModule } from "./blob-storage/blob-storage.module";
import { BootstrapModule } from "./bootstrap/bootstrap.module";
import { DatabaseModule } from "./database/database.module";
import { DocumentModule } from "./document/document.module";
import { GroupModule } from "./group/group.module";
import { HitlModule } from "./hitl/hitl.module";
import { LabelingModule } from "./labeling/labeling.module";
import { LoggingModule } from "./logging/logging.module";
import { MetricsModule } from "./metrics/metrics.module";
import { OcrModule } from "./ocr/ocr.module";
import { QueueModule } from "./queue/queue.module";
import { TemporalModule } from "./temporal/temporal.module";
import { TrainingModule } from "./training/training.module";
import { UploadModule } from "./upload/upload.module";
import { WorkflowModule } from "./workflow/workflow.module";
@Module({
imports: [
LoggingModule,
ConfigModule.forRoot({
isGlobal: true,
envFilePath: ".env",
cache: true,
}),
ScheduleModule.forRoot(),
ThrottlerModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (config: ConfigService) => ({
throttlers: [
{
name: "default",
ttl: config.get<number>("THROTTLE_GLOBAL_TTL_MS", 60_000),
limit: config.get<number>("THROTTLE_GLOBAL_LIMIT", 100),
},
],
}),
}),
AuthModule,
ApiKeyModule,
AuditModule,
BenchmarkModule,
DatabaseModule,
DocumentModule,
QueueModule,
UploadModule,
TemporalModule,
OcrModule,
LabelingModule,
HitlModule,
BlobStorageModule,
TrainingModule,
WorkflowModule,
AzureModule,
BootstrapModule,
GroupModule,
MetricsModule,
],
providers: [
{
provide: APP_GUARD,
useClass: ThrottlerGuard,
},
],
})
export class AppModule {}