move to env var

This commit is contained in:
Devin Zuczek
2026-06-29 23:48:29 -04:00
parent c9ec13fc6c
commit 311ff6b1f7
2 changed files with 36 additions and 18 deletions
+15 -7
View File
@@ -113,13 +113,21 @@ cp env.example.json env.json
# edit env.json and set "domain" to your domain
```
`just deploy` reads `env.json` at deploy time and passes the base domain to
wrangler — each worker is attached to its custom domain via `--domain
<subdomain>.<domain>`, and the base domain is injected as the `DOMAIN` var so
the `ns` service-discovery document and the api share-link base URL are built at
runtime. Nothing in version control is rewritten; committed `wrangler.jsonc`
files have no routes, and per-app subdomain overrides live under `subdomains` in
`env.json`.
`just deploy` resolves the base domain at deploy time and passes it to wrangler —
each worker is attached to its custom domain via `--domain <subdomain>.<domain>`,
and the base domain is injected as the `DOMAIN` var so the `ns` service-discovery
document and the api share-link base URL are built at runtime. Nothing in version
control is rewritten; committed `wrangler.jsonc` files have no routes.
The domain is read from the `RECFLARE_DOMAIN` environment variable if set,
otherwise from `env.json`. Per-app subdomain overrides come from
`RECFLARE_SUBDOMAINS` (a JSON object, e.g. `{"playersettings":"settings"}`) or
the `subdomains` key in `env.json`. For CI, set `RECFLARE_DOMAIN` as a secret and
skip `env.json` entirely:
```bash
RECFLARE_DOMAIN=rec.example.com just deploy
```
**Run the development server:**