mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 22:25:42 +00:00
IAM, package, luggage, app health, rate limit, and more
This commit is contained in:
@@ -4,6 +4,8 @@ import {
|
||||
NestModule,
|
||||
OnApplicationBootstrap,
|
||||
} from '@nestjs/common';
|
||||
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { ScheduleModule } from '@nestjs/schedule';
|
||||
import { EventEmitterModule } from '@nestjs/event-emitter';
|
||||
@@ -59,9 +61,16 @@ import { AuditModuleFeature } from './modules/audit/audit.module';
|
||||
import { CurrenciesModule } from './modules/currencies/currencies.module';
|
||||
import { SystemConfigModule } from './modules/system-config/system-config.module';
|
||||
import { PackagesModule } from './modules/packages/packages.module';
|
||||
import { ExcessBaggageModule } from './modules/excess-baggage/excess-baggage.module';
|
||||
import { HealthModule } from './modules/health/health.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ThrottlerModule.forRoot([
|
||||
{ name: 'auth', ttl: 60_000, limit: 5 },
|
||||
{ name: 'strict', ttl: 60_000, limit: 20 },
|
||||
{ name: 'default', ttl: 60_000, limit: 100 },
|
||||
]),
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
load: [
|
||||
@@ -120,8 +129,11 @@ import { PackagesModule } from './modules/packages/packages.module';
|
||||
CurrenciesModule,
|
||||
SystemConfigModule,
|
||||
PackagesModule,
|
||||
ExcessBaggageModule,
|
||||
HealthModule,
|
||||
],
|
||||
providers: [
|
||||
{ provide: APP_GUARD, useClass: ThrottlerGuard },
|
||||
EdrPassengerOrgSeeder,
|
||||
PassengerStaffUsersSeeder,
|
||||
],
|
||||
@@ -139,7 +151,15 @@ export class AppModule implements OnApplicationBootstrap {
|
||||
} catch (err) {
|
||||
console.error('[DataSeeder] Seed failed (non-fatal):', (err as Error).message);
|
||||
}
|
||||
await this.edrPassengerOrgSeeder.run();
|
||||
await this.passengerStaffUsersSeeder.run();
|
||||
try {
|
||||
await this.edrPassengerOrgSeeder.run();
|
||||
} catch (err) {
|
||||
console.error('[EdrPassengerOrgSeeder] Seed failed (non-fatal):', (err as Error).message);
|
||||
}
|
||||
try {
|
||||
await this.passengerStaffUsersSeeder.run();
|
||||
} catch (err) {
|
||||
console.error('[PassengerStaffUsersSeeder] Seed failed (non-fatal):', (err as Error).message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user