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.