Skip to content

Proxy UK Python (/uk/python) and API (/uk/api) docs through the website host#1065

Merged
vahid-ahmadi merged 1 commit into
mainfrom
investigate/uk-python-page
Jun 5, 2026
Merged

Proxy UK Python (/uk/python) and API (/uk/api) docs through the website host#1065
vahid-ahmadi merged 1 commit into
mainfrom
investigate/uk-python-page

Conversation

@vahid-ahmadi

Copy link
Copy Markdown
Contributor

Summary

The website's "Python" and "API" nav links are country-parameterized (/${countryId}/python, /${countryId}/api in Header.tsx), but only the US variants were proxied through the website host. So on UK pages those links 404'd, even though the upstream household-api-docs-policy-engine.vercel.app deployment already serves correct UK content.

This PR adds the missing host rewrites in website/next.config.ts, mirroring the existing /us/* proxies:

  • /uk/api, /uk/api/:path*.../uk/api/...
  • /uk/python, /uk/python/:path*.../uk/python...

No vercel.json or appZoneRoutes.ts change is needed — these legacy host rewrites follow the same already-passing pattern as /us/python and /us/api.

Verification (done before opening)

  • Upstream content is correct UK, not a US copy: /uk/python renders pip install "policyengine[uk]", uses pe.uk.calculate_household, GBP, UK regions, Universal Credit — 9 policyengine-uk refs, 0 policyengine-us. /uk/api documents POST household.api.policyengine.org/uk/calculate. Both return 200 upstream.
  • Shared asset proxy already covers UK: the existing /_zones/household-api-docs/:path* rewrite serves both countries' _next assets (same setup /us/python uses in production today).
  • CI guards pass: guard-vercel-zone-rewrites only inspects vercel.json (untouched); the multizone-tracking audit fetches /uk/python and finds the GA4 bootstrap (G-2YHG89FY0N) on the upstream page; /uk/api is skipped by the audit's /api/ rule, identical to /us/api.

Test plan

  • After deploy, visit /uk/python and /uk/api and confirm they render (not 404).
  • On a UK page, click the "Python" and "API" nav links and confirm they resolve.
  • Confirm /us/python and /us/api still work (unchanged).

Follow-ups (out of scope, optional)

  • app/scripts/generate-llms-txt.ts hardcodes the US package/API link only — could add policyengine-uk / /uk/api lines.
  • website/src/app/sitemap.ts lists neither US nor UK docs pages — adding "api"/"python" to staticPages would surface both.

🤖 Generated with Claude Code

Add /uk/python and /uk/api rewrites to website/next.config.ts,
mirroring the existing /us/* proxies to the household-api-docs
deployment. The upstream deployment already serves the UK pages
(verified 200 with correct policyengine-uk content); only the host
proxy was missing, so the country-parameterized "Python" and "API"
nav links 404'd on UK pages. Now they resolve.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment Jun 5, 2026 11:45am
policyengine-calculator Ready Ready Preview, Comment Jun 5, 2026 11:45am
policyengine-calculator-next Ready Ready Preview, Comment Jun 5, 2026 11:45am
policyengine-website Ready Ready Preview, Comment Jun 5, 2026 11:45am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant