-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.module.ts
34 lines (33 loc) · 1.14 KB
/
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
32
33
34
import { Module } from '@nestjs/common'
import { MongooseModule } from '@nestjs/mongoose'
import { ConfigModule, ConfigService } from '@nestjs/config'
import { HttpModule } from '@nestjs/axios'
import configuration from '@config'
import * as controllers from '@controllers'
import * as services from '@services'
import { Metadata, MetadataSchema } from '@schemas'
import { GoogleVerifier } from '@verifiers/google.verifier'
@Module({
imports: [
HttpModule,
ConfigModule.forRoot({
load: [configuration],
}),
MongooseModule.forRootAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => {
return {
uri: configService.get<string>('database.mongoUri'),
}
},
inject: [ConfigService],
}),
MongooseModule.forFeature([
{ name: Metadata.name, schema: MetadataSchema },
]),
ConfigModule,
],
controllers: [].concat(Object.values(controllers)),
providers: [].concat(Object, Object.values(services), GoogleVerifier),
})
export class AppModule {}