/
app.module.ts
31 lines (30 loc) · 1.05 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
import { Module, Logger } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { Neo4jModule, Neo4jConfig } from 'nest-neo4j';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { UserModule } from './user/user.module';
import { ArticleModule } from './article/article.module';
@Module({
imports: [
ConfigModule.forRoot({ isGlobal: true }),
Neo4jModule.forRootAsync({
imports: [ ConfigModule ],
inject: [ ConfigService ],
useFactory: (configService: ConfigService): Neo4jConfig => ({
scheme: configService.get('NEO4J_SCHEME'),
host: configService.get('NEO4J_HOST'),
port: configService.get('NEO4J_PORT'),
username: configService.get('NEO4J_USERNAME'),
password: configService.get('NEO4J_PASSWORD'),
database: configService.get('NEO4J_DATABASE'),
})
}),
UserModule,
ArticleModule,
],
providers: [AppService],
controllers: [AppController],
exports: []
})
export class AppModule {}