Skip to content

Commit

Permalink
feat: exclusive ICM url for SSR process
Browse files Browse the repository at this point in the history
  • Loading branch information
dhhyi committed Apr 11, 2024
1 parent 553e05a commit b873105
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/guides/ssr-startup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b873105

Please sign in to comment.