From a9dde22a50b12b12588ea2e46b00bbfce9a899eb Mon Sep 17 00:00:00 2001 From: Pratapa Lakshmi Date: Sun, 27 Oct 2024 13:01:08 +0530 Subject: [PATCH] chore: make vite domain configurable --- apps/kyb-app/entrypoint.sh | 4 ++-- apps/kyb-app/public/config.js | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/kyb-app/entrypoint.sh b/apps/kyb-app/entrypoint.sh index f55af68b2f..fc90b86708 100644 --- a/apps/kyb-app/entrypoint.sh +++ b/apps/kyb-app/entrypoint.sh @@ -2,7 +2,7 @@ if [[ -z "$VITE_DOMAIN" ]] then - VITE_DOMAIN="localhost:3000" + VITE_DOMAIN="http://localhost:3000" fi if [[ -z "$VITE_API_KEY" ]] @@ -33,7 +33,7 @@ fi cat << EOF > /usr/share/nginx/html/config.js globalThis.env = { - VITE_API_URL: "http://$VITE_DOMAIN/api/v1/", + VITE_API_URL: "$VITE_DOMAIN/api/v1/", VITE_API_KEY: "$VITE_API_KEY", VITE_ENVIRONMENT_NAME: "$VITE_ENVIRONMENT_NAME", VITE_DEFAULT_EXAMPLE_TOKEN: "$VITE_DEFAULT_EXAMPLE_TOKEN", diff --git a/apps/kyb-app/public/config.js b/apps/kyb-app/public/config.js index 848334361d..9d3a86f938 100644 --- a/apps/kyb-app/public/config.js +++ b/apps/kyb-app/public/config.js @@ -1,9 +1,9 @@ globalThis.env = { - VITE_API_URL: 'http://google.com', - VITE_KYB_DEFINITION_ID: "kyb_parent_kyc_session_example", - VITE_API_KEY: "secret", - VITE_ENVIRONMENT_NAME: "local", - VITE_DEFAULT_EXAMPLE_TOKEN: 12345678-1234-1234-1234-123456789012, - VITE_SENTRY_AUTH_TOKEN: "", - VITE_SENTRY_DSN: "", + VITE_API_URL: import.meta.env.VITE_API_URL || 'http://google.com', + VITE_KYB_DEFINITION_ID: import.meta.env.VITE_KYB_DEFINITION_ID || 'kyb_parent_kyc_session_example', + VITE_API_KEY: import.meta.env.VITE_API_KEY || 'secret', + VITE_ENVIRONMENT_NAME: import.meta.env.VITE_ENVIRONMENT_NAME || 'local', + VITE_DEFAULT_EXAMPLE_TOKEN: import.meta.env.VITE_DEFAULT_EXAMPLE_TOKEN || '12345678-1234-1234-1234-123456789012', + VITE_SENTRY_AUTH_TOKEN: import.meta.env.VITE_SENTRY_AUTH_TOKEN || '', + VITE_SENTRY_DSN: import.meta.env.VITE_SENTRY_DSN || '', };