mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-22 04:31:35 +10:00
73 lines
2.1 KiB
TypeScript
73 lines
2.1 KiB
TypeScript
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: [
|
|
// Core Modules
|
|
ConfigModule,
|
|
DatabaseModule,
|
|
MailModule,
|
|
RavenModule,
|
|
HealthModule,
|
|
|
|
// Feature Modules
|
|
AuthModule.register(),
|
|
UserModule,
|
|
ResumeModule,
|
|
StorageModule,
|
|
PrinterModule,
|
|
FeatureModule,
|
|
TranslationModule,
|
|
ContributorsModule,
|
|
|
|
// Static Assets
|
|
ServeStaticModule.forRoot({
|
|
serveRoot: "/artboard",
|
|
// eslint-disable-next-line unicorn/prefer-module
|
|
rootPath: path.join(__dirname, "..", "artboard"),
|
|
}),
|
|
ServeStaticModule.forRoot({
|
|
renderPath: "/*",
|
|
// eslint-disable-next-line unicorn/prefer-module
|
|
rootPath: path.join(__dirname, "..", "client"),
|
|
}),
|
|
],
|
|
providers: [
|
|
{
|
|
provide: APP_PIPE,
|
|
useClass: ZodValidationPipe,
|
|
},
|
|
{
|
|
provide: APP_INTERCEPTOR,
|
|
useValue: new RavenInterceptor({
|
|
filters: [
|
|
// Filter all HttpException with status code <= 500
|
|
{
|
|
type: HttpException,
|
|
filter: (exception: HttpException) => exception.getStatus() < 500,
|
|
},
|
|
],
|
|
}),
|
|
},
|
|
],
|
|
})
|
|
export class AppModule {}
|