diff --git a/bimex-frontend/.env.example b/bimex-frontend/.env.example index 0e67afd..dd33fdd 100644 --- a/bimex-frontend/.env.example +++ b/bimex-frontend/.env.example @@ -15,12 +15,20 @@ VITE_LAUNCHTUBE_JWT= # Get project ID at https://cloud.walletconnect.com VITE_WALLETCONNECT_PROJECT_ID=c4f79cc821944d9680842e34466bfda0 -# Indexer API URL (for faucet and data queries) +# Indexer REST (faucet, transparencia, casos de éxito) VITE_API_URL=http://localhost:3001 -# Indexer API (for SSE real-time updates) +# Indexer (SSE, IPFS upload proxy) VITE_INDEXER_URL=http://localhost:3001 +# Same-origin /api proxy (production or staging): +# 1. In vercel.json, add /api/:path* → https:///:path* (never commit placeholder hosts). +# Staging is wired for bimex-staging.vercel.app → bimex-indexer-staging.vercel.app in vercel.json. +# 2. In Vercel env vars set: +# VITE_API_URL=/api +# VITE_INDEXER_URL=/api +# connect-src 'self' in CSP covers same-origin /api. SSE via Vercel proxy may hit connection duration limits. + # Supabase (for notification preferences) VITE_SUPABASE_URL=https://.supabase.co VITE_SUPABASE_ANON_KEY= diff --git a/bimex-frontend/vercel.json b/bimex-frontend/vercel.json index bc1d1c3..0078dd8 100644 --- a/bimex-frontend/vercel.json +++ b/bimex-frontend/vercel.json @@ -1,5 +1,12 @@ { - "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }], + "rewrites": [ + { + "source": "/api/:path*", + "has": [{ "type": "host", "value": "bimex-staging.vercel.app" }], + "destination": "https://bimex-indexer-staging.vercel.app/:path*" + }, + { "source": "/(.*)", "destination": "/index.html" } + ], "headers": [ { "source": "/(.*)",