-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
app.module.ts
31 lines (30 loc) · 961 Bytes
/
app.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { MiddlewareConsumer, Module } from '@nestjs/common';
import { UserModule } from './user/user.module';
import { ConfigModule } from '@nestjs/config';
import { DbModule } from './db/db.module';
import { getConfig } from './services/app-config/configuration';
import { AppCacheModule } from './app-cache/app-cache.module';
import { LoggerModule } from './logger/logger.module';
import { AsyncStorageMiddleware } from './global/middleware/async-storage/async-storage.middleware';
import { GlobalModule } from './global/global.module';
import { HealthModule } from './health/health.module';
@Module({
imports: [
GlobalModule,
ConfigModule.forRoot({
cache: true,
load: [getConfig],
}),
DbModule,
AppCacheModule,
UserModule,
ConfigModule,
LoggerModule,
HealthModule,
],
})
export class AppModule {
configure(consumer: MiddlewareConsumer) {
consumer.apply(AsyncStorageMiddleware).forRoutes('*');
}
}