feat(console): point /api at the BenzoNet L1 BFF#57
Conversation
…space) The console is a thin client over the BFF; app-side BenzoNet config already matches the live manifest (eERC 0xEE46418e…, Registrar 0x0B1f4e78…). This repoints the /api rewrite from the Fuji-era Cloud Run backend to the BenzoNet API instance now live on our Azure VM (its own DB, ops key, dev zk-artifacts, L1 RPC; API_DOMAIN=console.benzo.space).
📝 WalkthroughWalkthroughThe console’s Vercel configuration changes the ChangesAPI routing
Estimated code review effort: 2 (Simple) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
| "framework": "vite", | ||
| "rewrites": [ | ||
| { "source": "/api/:path*", "destination": "https://benzo-api-dzv6bwbpba-ue.a.run.app/:path*" }, | ||
| { "source": "/api/:path*", "destination": "https://benzonet-api.benzo.space/:path*" }, |
There was a problem hiding this comment.
Preview deployments will proxy to the live production backend
The destination URL is hardcoded to benzonet-api.benzo.space, so every Vercel preview deployment (e.g. benzo-console-git-feat-*.vercel.app) will proxy /api to the same production BenzoNet BFF. Combined with API_DOMAIN=console.benzo.space on the backend, SIWE nonce verification and auth flows will fail for any origin that isn't console.benzo.space. This means PR preview links effectively can't be used for end-to-end testing of auth-gated flows.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/console/vercel.json
Line: 7
Comment:
**Preview deployments will proxy to the live production backend**
The destination URL is hardcoded to `benzonet-api.benzo.space`, so every Vercel preview deployment (e.g. `benzo-console-git-feat-*.vercel.app`) will proxy `/api` to the same production BenzoNet BFF. Combined with `API_DOMAIN=console.benzo.space` on the backend, SIWE nonce verification and auth flows will fail for any origin that isn't `console.benzo.space`. This means PR preview links effectively can't be used for end-to-end testing of auth-gated flows.
How can I resolve this? If you propose a fix, please make it concise.|
Greptile note (preview→prod backend): acknowledged — the destination is a fixed URL like the previous Cloud Run one. For BenzoNet specifically this is low-risk (it's our own permissioned test L1, not real-money mainnet), so preview builds hitting the same BFF is acceptable for now. Worth parameterizing via a Vercel env + |
Closes #56. Repoints the console's
/apirewrite tohttps://benzonet-api.benzo.space— the BenzoNet BFF instance now live on our Azure VM (benzo-api-benzonet: CHAIN_ENV=benzonet, chain 68420, eERC 0xEE46418e…, own Postgres, funded ops key, dev zk-artifacts, L1 RPC via socat;API_DOMAIN=console.benzo.spaceso SIWE verifies; CORS allows console.benzo.space). Health:https://benzonet-api.benzo.space/healthz→ 200. App-side BenzoNet config already matches the live manifest.Summary by CodeRabbit
Greptile Summary
This PR updates the Vercel rewrite rule in
apps/console/vercel.jsonto point/apiproxy traffic at the newly live BenzoNet BFF (benzonet-api.benzo.space) instead of the previous Cloud Run endpoint. The change is a single-line URL swap with no structural modifications.benzonet-api.benzo.space) replacing the previous Google Cloud Run URL; HTTPS is preserved and the rewrite pattern is unchanged.console.benzo.spaceorigins.Confidence Score: 4/5
Safe to merge for production; the one-line change correctly points the console at the live BenzoNet BFF with HTTPS intact.
The URL swap is correct and the rewrite pattern is untouched. The only notable trade-off is that every Vercel preview deployment will silently proxy to the live production backend, and SIWE domain-binding will block auth on those previews — but that is a pre-existing limitation of this deployment pattern rather than a regression introduced here.
No files require special attention;
apps/console/vercel.jsonis the only changed file and the change is minimal.Important Files Changed
/apirewrite destination — from a Cloud Run URL tobenzonet-api.benzo.space; no structural changes, but the hardcoded production URL means all Vercel preview deployments will proxy to the live BenzoNet backend.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Browser participant Vercel as Vercel Edge (console.benzo.space) participant BFF as BenzoNet BFF (benzonet-api.benzo.space) Browser->>Vercel: "GET /api/:path*" Note over Vercel: Rewrite rule matches /api/:path* Vercel->>BFF: "Proxy → https://benzonet-api.benzo.space/:path*" BFF-->>Vercel: Response (CORS allows console.benzo.space) Vercel-->>Browser: Forwarded response Browser->>Vercel: GET /(non-api path) Note over Vercel: SPA fallback rule Vercel-->>Browser: /index.html%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Browser participant Vercel as Vercel Edge (console.benzo.space) participant BFF as BenzoNet BFF (benzonet-api.benzo.space) Browser->>Vercel: "GET /api/:path*" Note over Vercel: Rewrite rule matches /api/:path* Vercel->>BFF: "Proxy → https://benzonet-api.benzo.space/:path*" BFF-->>Vercel: Response (CORS allows console.benzo.space) Vercel-->>Browser: Forwarded response Browser->>Vercel: GET /(non-api path) Note over Vercel: SPA fallback rule Vercel-->>Browser: /index.htmlPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat(console): point /api at the BenzoNe..." | Re-trigger Greptile