import { Module } from '@nestjs/common'; import { MulterModule } from '@nestjs/platform-express'; import { ReauthModule } from '../auth/reauth/reauth.module'; import { BackupController } from './backup.controller'; import { BackupService } from './backup.service'; import { BackupSchedulerService } from './backup-scheduler.service'; import { BackupSettingsService } from './backup-settings.service'; import { backupMaxImportBytes } from './backup-import-limit'; @Module({ imports: [ ReauthModule, // Upload limit of POST /backup/import. A factory rather than a constant // in the decorator: it runs once the app starts, after ConfigModule has // loaded .env, so the limit is the same one exports are checked against. MulterModule.registerAsync({ useFactory: () => ({ limits: { fileSize: backupMaxImportBytes() } }), }), ], controllers: [BackupController], providers: [BackupService, BackupSchedulerService, BackupSettingsService], }) export class BackupModule {}