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}` : '';