fix service subdomains env var not working

This commit is contained in:
Devin Zuczek
2026-08-01 17:15:11 -04:00
parent 3030b480c8
commit cf05026285
6 changed files with 81 additions and 11 deletions
+11 -4
View File
@@ -7,11 +7,18 @@ discover every service host (Accounts, API, Auth, Econ, Matchmaking,
Notifications, …).
Each host is built at runtime from the `DOMAIN` var (the base domain) plus the
service → subdomain map in `src/endpoints.ts`. `DOMAIN` is injected at deploy
time from `RECFLARE_DOMAIN` (see `run-wrangler-deploy`) and defaults to
`rec.example.com` in `wrangler.jsonc` for local dev.
service → subdomain map in `src/endpoints.ts`, with the `SUBDOMAINS` var applied
on top. Both vars are injected at deploy time from `RECFLARE_DOMAIN` and
`RECFLARE_SUBDOMAINS` (see `run-wrangler-deploy`) and default to
`rec.example.com` / `{}` in `wrangler.jsonc` for local dev.
## Updating endpoints
- To change the base domain, set `RECFLARE_DOMAIN` (in `.env`) and redeploy.
- To add or rename a service host, edit the map in `src/endpoints.ts`.
- To point one service at a different host, add it to `RECFLARE_SUBDOMAINS` (in
`.env`) and redeploy. It's keyed by the service's _default_ subdomain — the
same object `run-wrangler-deploy` reads to pick a worker's host, so an entry
moves the deployed worker and the advertised host together. An entry for a
service with no worker (e.g. `{"moderation":"api"}`) is a pure client-side
redirect onto a host another worker already serves.
- To add or rename a service, edit the map in `src/endpoints.ts`.