Proxy UK Python (/uk/python) and API (/uk/api) docs through the website host#1065
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The website's "Python" and "API" nav links are country-parameterized (
/${countryId}/python,/${countryId}/apiinHeader.tsx), but only the US variants were proxied through the website host. So on UK pages those links 404'd, even though the upstreamhousehold-api-docs-policy-engine.vercel.appdeployment 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.jsonorappZoneRoutes.tschange is needed — these legacy host rewrites follow the same already-passing pattern as/us/pythonand/us/api.Verification (done before opening)
/uk/pythonrenderspip install "policyengine[uk]", usespe.uk.calculate_household, GBP, UK regions, Universal Credit — 9policyengine-ukrefs, 0policyengine-us./uk/apidocumentsPOST household.api.policyengine.org/uk/calculate. Both return 200 upstream./_zones/household-api-docs/:path*rewrite serves both countries'_nextassets (same setup/us/pythonuses in production today).guard-vercel-zone-rewritesonly inspectsvercel.json(untouched); the multizone-tracking audit fetches/uk/pythonand finds the GA4 bootstrap (G-2YHG89FY0N) on the upstream page;/uk/apiis skipped by the audit's/api/rule, identical to/us/api.Test plan
/uk/pythonand/uk/apiand confirm they render (not 404)./us/pythonand/us/apistill work (unchanged).Follow-ups (out of scope, optional)
app/scripts/generate-llms-txt.tshardcodes the US package/API link only — could addpolicyengine-uk//uk/apilines.website/src/app/sitemap.tslists neither US nor UK docs pages — adding"api"/"python"tostaticPageswould surface both.🤖 Generated with Claude Code