From ff8b5cc7d5b1f3c976810d900df35ba1d6717669 Mon Sep 17 00:00:00 2001 From: Gokul Date: Thu, 21 May 2026 12:29:19 +0530 Subject: [PATCH] 21052026 --- vite.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vite.config.js b/vite.config.js index 356f83e..f3f8220 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,11 +3,11 @@ import react from '@vitejs/plugin-react' // Dev mode: proxy /api/* to api.workolik.com and inject x-hasura-admin-secret // server-side so the secret never reaches the browser. -export default defineConfig(({ mode }) => { +export default defineConfig(({ command, mode }) => { const env = loadEnv(mode, process.cwd(), '') const secret = (env.HASURA_ADMIN_SECRET || '').trim() - if (!secret) { + if (!secret && command === 'serve') { console.warn('[xpress-docs] HASURA_ADMIN_SECRET is not set in .env.local; proxied requests will hit the API without auth.') } @@ -23,9 +23,9 @@ export default defineConfig(({ mode }) => { } }, '/live': { - target: 'https://jupiter.nearle.app', + target: env.VITE_LIVE_API_TARGET || 'https://jupiter.nearle.app', changeOrigin: true, - secure: true, + secure: env.VITE_LIVE_API_TARGET ? false : true, } }