diff --git a/docs/guides/ssr-startup.md b/docs/guides/ssr-startup.md index a7fc277b5e..e58f2b8b22 100644 --- a/docs/guides/ssr-startup.md +++ b/docs/guides/ssr-startup.md @@ -50,6 +50,7 @@ Make sure to use them as written in the table below. | | CONCURRENCY_SSR | number \| max | Concurrency for SSR instances per theme (default: 2) | | | CACHE_ICM_CALLS | recommended \| JSON | Enable caching for ICM calls, see [Local ICM Cache](#local-icm-cache) (default: disabled) | | **General** | ICM_BASE_URL | string | Sets the base URL for the ICM | +| | ICM_BASE_URL_SSR | string | Sets the base URL for the ICM used in SSR (optional) | | | ICM_CHANNEL | string | Overrides the default channel | | | ICM_APPLICATION | string | Overrides the default application | | | FEATURES | comma-separated list | Overrides active features | diff --git a/src/app/core/store/core/configuration/configuration.selectors.ts b/src/app/core/store/core/configuration/configuration.selectors.ts index 4211f3ef4a..f0b645bf6f 100644 --- a/src/app/core/store/core/configuration/configuration.selectors.ts +++ b/src/app/core/store/core/configuration/configuration.selectors.ts @@ -16,8 +16,10 @@ export const getResponsiveStarterStoreApplication = createSelector( state => state.hybridApplication || '-' ); +const ssrBaseUrl = typeof process !== 'undefined' && process.env.ICM_BASE_URL_SSR; + export const getICMServerURL = createSelector(getConfigurationState, state => - state.baseURL && state.server ? `${state.baseURL}/${state.server}` : undefined + state.baseURL && state.server ? `${ssrBaseUrl || state.baseURL}/${state.server}` : undefined ); export const getRestEndpoint = createSelector(