feature flags
This commit is contained in:
@@ -42,7 +42,8 @@ export const ApiModule = new ContainerModule((options) => {
|
||||
ClientClass: any,
|
||||
context: any
|
||||
) => {
|
||||
const baseUrl = context.get(CONFIG_TOKEN);
|
||||
const getConfig = context.get(CONFIG_TOKEN);
|
||||
const baseUrl = getConfig(); // Call function to get fresh config
|
||||
const errorReporter = context.get(ERROR_REPORTER_TOKEN);
|
||||
const logger = context.get(LOGGER_TOKEN);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export const CoreModule = new ContainerModule((options) => {
|
||||
})
|
||||
.inSingletonScope();
|
||||
|
||||
// Config
|
||||
bind<string>(CONFIG_TOKEN)
|
||||
.toConstantValue(getWebsiteApiBaseUrl());
|
||||
// Config - bind as function to read env at runtime
|
||||
bind<() => string>(CONFIG_TOKEN)
|
||||
.toDynamicValue(() => () => getWebsiteApiBaseUrl());
|
||||
});
|
||||
Reference in New Issue
Block a user