diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5a83bec70..2da733e77 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -5,6 +5,7 @@ set -e sed -i "s@{FHIR_URL}@$FHIR_URL@g" /etc/nginx/conf.d/nginx.conf sed -i "s@{BACK_URL}@$BACK_URL@g" /etc/nginx/conf.d/nginx.conf +sed -i "s@{VITE_CONFIG_URL}@$VITE_CONFIG_URL@g" /app/build/assets/*.js sed -i "s@{VITE_CLARITY_APP_ID}@$VITE_CLARITY_APP_ID@g" /app/build/index.html diff --git a/src/constants.js b/src/constants.js index c4c8d4c9f..7a79f9ffc 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,6 +1,7 @@ const ENV_CONFIG_URL = import.meta.env.DEV ? import.meta.env.VITE_CONFIG_URL : '{VITE_CONFIG_URL}' -export const CONFIG_URL = - ENV_CONFIG_URL === '{' + 'VITE_CONFIG_URL' + '}' ? '/config.json' : ENV_CONFIG_URL || '/config.json' +export const CONFIG_URL = !!`${ENV_CONFIG_URL}`.match('VITE_CONFIG_URL') + ? '/config.json' + : `${ENV_CONFIG_URL}` || '/config.json' export const ACCESS_TOKEN = 'access_token' export const REFRESH_TOKEN = 'refresh_token'