Domain routing debug

Custom domain routing overview

This page shows how custom domain routing is configured in the proof-of-concept app. In production the domain map would be read from a Redis/KV cache, not from a hardcoded file.

Platform hosts (pass-through — no rewrite)

Add your production platform domain to src/lib/domain-map.js PLATFORM_HOSTS.

Domain map (custom domain → site identifier)

Custom domainSite identifierRewrites to
maya.example.localdemo-creator/demo/demo-creator
studio.example.localstudio-oasis/demo/studio-oasis
card.example.localprofile-card-demo/demo/profile-card-demo
legacy.example.locallegacy-public-demo/demo/legacy-public-demo

Edit src/lib/domain-map.js DOMAIN_MAP to add or change custom domains.

Mock sites & their custom domains

Maya Lane

Identifier: demo-creatorCustom domain: maya.example.local
Open via /demo/ route →

Studio Oasis

Identifier: studio-oasisCustom domain: studio.example.local
Open via /demo/ route →

Avery Stone

Identifier: profile-card-demoCustom domain: card.example.local
Open via /demo/ route →

Avery Studio Showcase

Identifier: profile-card-showcase-demo
Open via /demo/ route →

Nora Atelier

Identifier: legacy-public-demoCustom domain: legacy.example.local
Open via /demo/ route →

How to test custom domains locally (Windows)

  1. 1. Open the Windows hosts file as administrator:

    C:\Windows\System32\drivers\etc\hosts
  2. 2. Add these lines at the bottom:

    127.0.0.1 maya.example.local
    127.0.0.1 studio.example.local
  3. 3. Visit in your browser (with port):

    http://maya.example.local:3001/http://studio.example.local:3001/

    The middleware rewrites the request and you see the matching site — same as visiting /demo/demo-creator — but from the custom domain.

  4. 4. Or test with curl (no hosts file needed):

    curl -H "Host: maya.example.local" http://localhost:3001/