diff --git a/.env_example b/.env_example index 81caf27585..e2834bbf03 100644 --- a/.env_example +++ b/.env_example @@ -41,6 +41,10 @@ ALGOLIA_API_KEY=684d998c36b67a9a9fce8fc2d8860579 # Enable PostHog debug logging in the browser console. # VITE_POSTHOG_DEBUG=true +# Override staging comfy-api / comfy-platform base URLs. +# VITE_STAGING_API_BASE_URL=https://stagingapi.comfy.org +# VITE_STAGING_PLATFORM_BASE_URL=https://stagingplatform.comfy.org + # Sentry ENV vars replace with real ones for debugging # SENTRY_AUTH_TOKEN=private-token # get from sentry # SENTRY_ORG=comfy-org diff --git a/src/config/comfyApi.ts b/src/config/comfyApi.ts index 8efd651bfb..b6a8e375af 100644 --- a/src/config/comfyApi.ts +++ b/src/config/comfyApi.ts @@ -12,11 +12,12 @@ const STAGING_PLATFORM_BASE_URL = 'https://stagingplatform.comfy.org' const BUILD_TIME_API_BASE_URL = __USE_PROD_CONFIG__ ? PROD_API_BASE_URL - : STAGING_API_BASE_URL + : (import.meta.env.VITE_STAGING_API_BASE_URL ?? STAGING_API_BASE_URL) const BUILD_TIME_PLATFORM_BASE_URL = __USE_PROD_CONFIG__ ? PROD_PLATFORM_BASE_URL - : STAGING_PLATFORM_BASE_URL + : (import.meta.env.VITE_STAGING_PLATFORM_BASE_URL ?? + STAGING_PLATFORM_BASE_URL) export function getComfyApiBaseUrl(): string { if (!isCloud) { diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 5080e6ba77..6dd540572f 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -19,6 +19,8 @@ declare global { interface ImportMetaEnv { VITE_APP_VERSION?: string + VITE_STAGING_API_BASE_URL?: string + VITE_STAGING_PLATFORM_BASE_URL?: string } interface ImportMeta {