diff --git a/index.html b/index.html index 8e66ab3..6bb83ca 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,8 @@ Krishna Sales + +
diff --git a/src/api/config.ts b/src/api/config.ts index d710a3f..c5b543c 100644 --- a/src/api/config.ts +++ b/src/api/config.ts @@ -5,7 +5,17 @@ // docs under src/docs/api. export const APP_ID = '434'; -export const BASE_URL = 'https://dev.getzino.in'; + +// Backend URL comes from the runtime config.js the frontgen server writes at +// placement time (window.__RUNTIME_CONFIG__.VITE_ZINO_API_URL) so one built +// artifact can be promoted across environments. The dev literal is only a +// fallback for local dev / a build served without config.js. +declare global { + interface Window { __RUNTIME_CONFIG__?: Record } +} +export const BASE_URL = + (typeof window !== 'undefined' && window.__RUNTIME_CONFIG__?.VITE_ZINO_API_URL) || + 'https://dev.getzino.in'; // --- Order Booking (src/docs/api/order_booking.md) --- export const ORDER_BOOKING = { diff --git a/vite.config.ts b/vite.config.ts index d4880cf..ae7fe15 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,7 +2,9 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' -const base = process.env.VITE_BASE_URL ?? '/krishna_sales' +// Relative base so the built artifact is mount-path agnostic; the target +// frontgen writes the real into index.html at placement time. +const base = './' export default defineConfig(() => ({ base,