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 ) : 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 { }