|
import path from "node:path"; |
|
|
|
import { HttpException, Module } from "@nestjs/common"; |
|
import { APP_INTERCEPTOR, APP_PIPE } from "@nestjs/core"; |
|
import { ServeStaticModule } from "@nestjs/serve-static"; |
|
import { RavenInterceptor, RavenModule } from "nest-raven"; |
|
import { ZodValidationPipe } from "nestjs-zod"; |
|
|
|
import { AuthModule } from "./auth/auth.module"; |
|
import { ConfigModule } from "./config/config.module"; |
|
import { ContributorsModule } from "./contributors/contributors.module"; |
|
import { DatabaseModule } from "./database/database.module"; |
|
import { FeatureModule } from "./feature/feature.module"; |
|
import { HealthModule } from "./health/health.module"; |
|
import { MailModule } from "./mail/mail.module"; |
|
import { PrinterModule } from "./printer/printer.module"; |
|
import { ResumeModule } from "./resume/resume.module"; |
|
import { StorageModule } from "./storage/storage.module"; |
|
import { TranslationModule } from "./translation/translation.module"; |
|
import { UserModule } from "./user/user.module"; |
|
|
|
@Module({ |
|
imports: [ |
|
|
|
ConfigModule, |
|
DatabaseModule, |
|
MailModule, |
|
RavenModule, |
|
HealthModule, |
|
|
|
|
|
AuthModule.register(), |
|
UserModule, |
|
ResumeModule, |
|
StorageModule, |
|
PrinterModule, |
|
FeatureModule, |
|
TranslationModule, |
|
ContributorsModule, |
|
|
|
|
|
ServeStaticModule.forRoot({ |
|
serveRoot: "/artboard", |
|
|
|
rootPath: path.join(__dirname, "..", "artboard"), |
|
}), |
|
ServeStaticModule.forRoot({ |
|
renderPath: "/*", |
|
|
|
rootPath: path.join(__dirname, "..", "client"), |
|
}), |
|
], |
|
providers: [ |
|
{ |
|
provide: APP_PIPE, |
|
useClass: ZodValidationPipe, |
|
}, |
|
{ |
|
provide: APP_INTERCEPTOR, |
|
useValue: new RavenInterceptor({ |
|
filters: [ |
|
|
|
{ |
|
type: HttpException, |
|
filter: (exception: HttpException) => exception.getStatus() < 500, |
|
}, |
|
], |
|
}), |
|
}, |
|
], |
|
}) |
|
export class AppModule {} |
|
|