-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.module.ts
More file actions
32 lines (31 loc) · 1.15 KB
/
app.module.ts
File metadata and controls
32 lines (31 loc) · 1.15 KB
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
32
import { ConfigModule, Interceptor } from '@lib/core';
import { OpenobserveModule } from '@lib/logger';
import { RepositoryModule } from '@lib/repository';
import { Module } from '@nestjs/common';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { EnvConfig } from './config/config.model';
import { AuthModule } from './modules/auth/auth.module';
import { UserModule } from './modules/user/user.module';
@Module({
imports: [
ConfigModule.register(EnvConfig),
RepositoryModule.forRootAsync({
inject: [EnvConfig],
useFactory: (config: EnvConfig) => config,
}),
OpenobserveModule.registerAsync({
inject: [EnvConfig],
useFactory: (config: EnvConfig) => ({
endpoint: config.OPENOBSERVE_ENDPOINT,
key: config.OPENOBSERVE_KEY,
organizationId: config.OPENOBSERVE_ORGANIZATION_ID,
appId: config.OPENOBSERVE_APP_ID,
user: config.OPENOBSERVE_USER,
}),
}),
UserModule,
AuthModule,
],
providers: [{ provide: APP_INTERCEPTOR, useClass: Interceptor }],
})
export class AppModule {}