title: how to access .env variables for Neo4j in Nestjs v8 app.module
body: <p>I have what appears to be a common problem without a common solution. I am trying to access my .env data from my Nestjs app.module while importing Neo4jModule. If I use hardcoded values everything works fine but neither process.env or configService seems to get the values. I have seem many examples of this problem but apparently the answer is quite elusive. I have tried the following variations of answers but none works. I do understand that we are a bit early in the initialization process but I can't figure out how to delay the request until the initialization is complete.</p>
  <pre><code>----&gt;app.module
  ........
   import configuration from './config/configuration';
   import { Neo4jConfig, Neo4jModule } from 'nest-neo4j'
   import { ConfigModule, ConfigService } from '@nestjs/config';
  
  
   @Module({
       imports: [DbServerModule,
                 ConfigModule.forRoot({
                   load: [configuration],
                   isGlobal: true
                 }),
                 Neo4jModule.forRootAsync({
                   imports: [ConfigModule],
                   useFactory: async (configService: ConfigService) =&gt; ({
                     scheme: 'bolt',                                    
                     host: configService.get('NEO4J_HOST'),            
                     port: configService.get('NEO4J_PORT'),               
                     username: configService.get('NEO4J_USERNAME'),    
                     password: configService.get('NEO4J_PASSWORD'),               
                }),
      
               inject: [ConfigService],
             }),
            ],
       ........
  
  OR
  @Module({
    imports: [DbServerModule,
              ConfigModule.forRoot({
                load: [configuration],
                isGlobal: true
              }),
              Neo4jModule.forRoot({
                  scheme: 'bolt',                                   // 
                  process.env.NEO4J_SCHEME, 
                  host: process.env.NEO4J_HOST, 
                  port: process.env.NEO4J_PORT,  
                  username: process.env.NEO4J_USERNAME, 
                  password: process.env.NEO4J_PASSWORD            
                }),
  
            ],
  </code></pre>
  <p>EDIT........
  The code below shows we have access to the .env variables within the useFactory {} block...the console.log logs the correct .env value, but still Neo4j connection fails because of the properties:</p>
  <pre><code>Neo4jModule.forRootAsync({
       inject: [ConfigService],
       useFactory: async (configService: ConfigService) =&gt; {         
       console.log(`USERNAME...
                  .${configService.get('NEO4J_USERNAME')}`);
       return ({
                scheme: 'bolt',                                    
                host: configService.get('NEO4J_HOST'),            
                port: configService.get('NEO4J_PORT'),               
                username: configService.get('NEO4J_USERNAME'),    
                password: configService.get('NEO4J_PASSWORD'),               
              });
            },
  </code></pre>
  <p>My production deployment will be using Rancher to assign the env variables and so I will be using a custom config file.. configuration.ts which I load in ConfigModule.forRoot. Any help with this would be much appreciated.</p>
  <p>I need to give a shout-out to @adamCowley for his work on the nest-neo4j wrapper. It has removed a lot of the complexities in integrating Nestjs with Neo4j...Thanks</p>
  <p>EDIT: per request:
  -config/configuration.ts</p>
  <pre><code>  .....
    NEO4J_SCHEME: process.env.NEO4J_SCHEME,       
      NEO4J_HOST: process.env.NEO4J_HOST,         
      NEO4J_USERNAME: process.env.NEO4J_USERNAME, 
      NEO4J_PASSWORD: process.env.NEO4J_PASSWORD, 
      NEO4J_PORT: process.env.NEO4J_PORT,
     ......
  </code></pre>
  <p>.env</p>
  <pre><code>........
  NEO4J_SCHEME='bolt'
  NEO4J_HOST='127.0.0.1',       
  NEO4J_USERNAME='username'
  NEO4J_PASSWORD='password'
  NEO4J_PORT=7687
  ..........
  
    
  </code></pre>