From d3f9bb25bb8e42156726e6609c6c0df401fc338a Mon Sep 17 00:00:00 2001 From: Chi-Sheng Liu Date: Fri, 19 Apr 2024 21:24:25 +0800 Subject: [PATCH] fix: Partial revert flyteorg/flyteconsole#853 Only set ADMIN_API_URL to localhost:30080 when NODE_ENV is development Signed-off-by: Chi-Sheng Liu --- website/console/env/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/website/console/env/index.ts b/website/console/env/index.ts index d18276e09..ed41902fe 100644 --- a/website/console/env/index.ts +++ b/website/console/env/index.ts @@ -31,7 +31,10 @@ const CERTIFICATE_PATH = '../../scripts/certificate'; const ADMIN_API_USE_SSL = process.env.ADMIN_API_USE_SSL || 'http'; // Admin domain used as base for window URL and API urls -const ADMIN_API_URL = process.env.ADMIN_API_URL?.replace(/https?:\/\//, '') || 'localhost:30080'; +const ADMIN_API_URL = + process.env.NODE_ENV === 'development' + ? 'localhost:30080' + : process.env.ADMIN_API_URL?.replace(/https?:\/\//, '') || ''; // If this is unset, API calls will default to the same host used to serve this app const ADMIN_API = ADMIN_API_URL ? `//${ADMIN_API_URL}` : '';