hasurafix
This commit is contained in:
@@ -5,7 +5,7 @@ import react from '@vitejs/plugin-react'
|
||||
// server-side so the secret never reaches the browser.
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
const secret = (env.HASURA_ADMIN_SECRET || '').trim()
|
||||
const secret = (env.HASURA_ADMIN_SECRET || 'nearle-admin-secret').trim()
|
||||
|
||||
if (!secret) {
|
||||
console.warn('[xpress-docs] HASURA_ADMIN_SECRET is not set in .env.local; proxied requests will hit the API without auth.')
|
||||
@@ -22,6 +22,16 @@ export default defineConfig(({ mode }) => {
|
||||
})
|
||||
}
|
||||
},
|
||||
'/v1': {
|
||||
target: 'https://api.workolik.com',
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
configure: (proxy) => {
|
||||
proxy.on('proxyReq', (proxyReq) => {
|
||||
if (secret) proxyReq.setHeader('x-hasura-admin-secret', secret)
|
||||
})
|
||||
}
|
||||
},
|
||||
'/live': {
|
||||
target: 'https://jupiter.nearle.app',
|
||||
changeOrigin: true,
|
||||
|
||||
Reference in New Issue
Block a user