#How to make sure the `AppController` being loaded after `ConfigService` is ready?

3 messages · Page 1 of 1 (latest)

solid shore
#

My AppController requires some function that initializess object with configuration value. For example

// app.controller.ts

@Controller()
export class AppController {
  constructor() {
    console.log(process.env.STORAGE_KEY);
    // this will print undefined, but in another controller it's works fine.
  }
}

I have config the ConfigModule to be loaded as Globally. And for some reason I can't use the ConfigService to get that env variable here.

jovial apex
ebon smelt