Skip to content

Staging needs an app-host counterpart so two-host routing resolves #212

Open

Description

@neuromechanist

Not a missing pattern — one missing hostname

The staging stack from epic #923 Phase 6 is in place and working. Confirmed in DNS:

host record serves
api-test.nemar.org AAAA 100:: nemar-cli Worker (dev)
data-test.nemar.org AAAA 100:: nemar-cli Worker (dev)
zarr-test.nemar.org AAAA 100:: nemar-cli Worker (dev)
test.nemar.org CNAME -> nemar-website-test.pages.dev website staging

The gap is narrower than "staging can't test routing". Production runs two website hosts — nemar.org (marketing) and app.nemar.org (app) — while staging runs one. The two-host split (#46) and the apex cutover (#190) landed on a different axis than the staging epic, so nothing here was missed at the time; staging is simply one hostname short of mirroring production's shape.

Consequence

hostMode() in src/lib/host.ts returns "app" for APP_HOSTS, "marketing" for MARKETING_HOSTS, and "single" for everything else. test.nemar.org is in neither set, so staging always resolves to single-host mode and the entire two-host layer is inert there:

*.pages.dev previews share the property, so neither staging nor previews cover it.

Why it is worth closing

This is the class of change that broke twice on 2026-07-29:

Ask

Add the app-host counterpart on staging, mirroring what already exists:

  1. app-test.nemar.org (name open to preference) as a DNS record plus a custom domain on the existing nemar-website-test Pages project — the same project, a second domain, exactly as production serves both hosts from one project.
  2. Teach host.ts about the staging pair. APP_HOSTS / MARKETING_HOSTS are plain literals today and several helpers key off them, so prefer environment-aware host sets over hardcoding staging names into the production constants. Staging must stay non-production for isProductionHost, so noindex and robots.txt Disallow: / are unchanged.
  3. Scope the staging session cookie to the new app host, mirroring production's Domain=app.nemar.org.
  4. Cover the staging pair in host.test.ts alongside the production-host cases.

Out of scope

Local dev. Cross-host routing against astro dev would need server.allowedHosts plus hosts-file entries; a working staging pair is the higher-value target and needs no dev-config change.

Activity

  1. added
    enhancement
    on Jul 29, 2026
  2. changed the title [-]Staging can't test two-host routing: test.nemar.org resolves to single-host mode[/-] [+]Staging needs an app-host counterpart so two-host routing resolves[/+] on Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions