Skip to content

fix(cms): keep the /admin prefix of PAYLOAD_URL (production) - #120

Merged
keshav-epyc merged 1 commit into
productionfrom
fix/payload-url-admin-base-production
Oct 4, 2026
Merged

keshav-epyc merged 1 commit into
productionfrom
fix/payload-url-admin-base-production

Conversation

@keshav-epyc

Copy link
Copy Markdown
Collaborator

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`:

  • `wrangler.jsonc` (default vars) and `.env.example`: `PAYLOAD_URL` was `https://cms.epyc.in\`, which no longer serves the CMS. Both now use the workers.dev `/admin` base.
  • `payload-provider.ts`: keeps production's error message; only the URL is now built by joining strings.
  • `ci.yml` and `CLAUDE.md`: production's versions are kept. On `main` these files carry other unreleased changes.

When `main` is next promoted, this change is already here and should merge cleanly.

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>
@xhawk-ai

xhawk-ai Bot commented Oct 4, 2026

Copy link
Copy Markdown

⚠️ XHawk Review paused — out of credits

Your team has run out of review credits, so I couldn't finish this review.
Top up to resume: → https://app.xhawk.ai/billing

@keshav-epyc
keshav-epyc merged commit b817909 into production Oct 4, 2026
1 check passed
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