Compare commits

...

2 Commits

Author SHA1 Message Date
df8ff4a058 Merge branch 'main' of ssh://gitapp.workolik.com:2222/Nearle_express/Express_developer_docs 2026-05-21 12:29:23 +05:30
ff8b5cc7d5 21052026 2026-05-21 12:29:19 +05:30

View File

@@ -3,11 +3,11 @@ import react from '@vitejs/plugin-react'
// Dev mode: proxy /api/* to api.workolik.com and inject x-hasura-admin-secret // Dev mode: proxy /api/* to api.workolik.com and inject x-hasura-admin-secret
// server-side so the secret never reaches the browser. // 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 env = loadEnv(mode, process.cwd(), '')
const secret = (env.HASURA_ADMIN_SECRET || '').trim() 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.') 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': { '/live': {
target: 'https://jupiter.nearle.app', target: env.VITE_LIVE_API_TARGET || 'https://jupiter.nearle.app',
changeOrigin: true, changeOrigin: true,
secure: true, secure: env.VITE_LIVE_API_TARGET ? false : true,
} }
} }