porcx
03/22/2022, 10:51 AMstatic forRoot({ connectionURI, apiKey, appInfo }: AuthModuleConfig): DynamicModule {
return {
providers: [
{
useValue: {
appInfo,
connectionURI,
apiKey,
},
provide: ConfigInjectionToken,
},
],
exports: [],
imports: [],
module: AuthModule,
};
}
And Then I have used this method to to app.module something like this
imports: [
AuthModule.forRoot({
connectionURI: process.env.AUTH_CONNECTION_URI,
appInfo: {
appName: "canopy",
apiDomain: process.env.API_DOMAIN,
websiteDomain: process.env.WEBSITE_DOMAIN,
apiBasePath: "/auth/",
websiteBasePath: "/",
},
}),
ConfigModule.forRoot({
isGlobal: true,
load: [config],
})
],
My question is how can i use configService to get the env values in AuthModule.forRoot function ?