Repository navigation
fix(cms): keep the /admin prefix of PAYLOAD_URL (production) - #120
Merged
Merged
Conversation
The CMS moves from cms.epyc.in to epyc.in/admin, and to share the host with
this site it serves everything — its REST API included — under /admin. The
API is therefore at <worker>/admin/api, and PAYLOAD_URL now carries the
prefix.
PayloadProvider built request URLs with new URL('/api/...', base), which
resolves an absolute path against the base's origin and discards its path.
With a prefixed base every read would have gone to /api/... and missed the
CMS. It concatenates instead.
Server-side reads keep using the workers.dev host rather than epyc.in/admin:
that is a route on this site's own zone, and this Worker fetching it is a
same-zone subrequest there is no reason to depend on.
Deploy after the CMS change: until then /admin/api on the CMS is the admin
UI's catch-all, not the REST API.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Your team has run out of review credits, so I couldn't finish this review. |
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.
Cherry-picks #119 (`75438af`) onto `production` by itself, so the ~15 other unreleased commits on `main` don't ship with it.
The CMS now serves its REST API under `/admin/api`. This makes `PayloadProvider` keep the base URL's path, and sets `PAYLOAD_URL` to `https://epyc-payload-cms.epyc.workers.dev/admin\`.
How the conflicts were resolved against `production`:
When `main` is next promoted, this change is already here and should merge cleanly.