2022-04-12 11:26:03 +02:00
|
|
|
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
2021-07-13 19:06:36 +02:00
|
|
|
import { ConfigModule } from '@nestjs/config';
|
|
|
|
|
2021-07-14 13:20:59 +02:00
|
|
|
import { baseConfig } from '@/config';
|
2021-07-19 14:50:34 +02:00
|
|
|
import { QueueModule, ApiModule } from '@/modules';
|
2022-04-12 11:26:03 +02:00
|
|
|
import { setHeadersMiddleware } from '@/modules/api/set-headers.middleware';
|
2021-07-13 19:06:36 +02:00
|
|
|
|
|
|
|
@Module({
|
|
|
|
imports: [
|
|
|
|
ConfigModule.forRoot({
|
|
|
|
load: [baseConfig],
|
|
|
|
isGlobal: true,
|
|
|
|
}),
|
2021-07-19 14:50:34 +02:00
|
|
|
ApiModule,
|
2021-07-13 19:06:36 +02:00
|
|
|
QueueModule,
|
|
|
|
],
|
|
|
|
})
|
2022-04-12 11:26:03 +02:00
|
|
|
export class AppModule implements NestModule {
|
|
|
|
configure(consumer: MiddlewareConsumer) {
|
|
|
|
consumer.apply(setHeadersMiddleware).forRoutes('/');
|
|
|
|
}
|
|
|
|
}
|