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 domain | Site identifier | Rewrites to |
|---|---|---|
| maya.example.local | demo-creator | /demo/demo-creator |
| studio.example.local | studio-oasis | /demo/studio-oasis |
| card.example.local | profile-card-demo | /demo/profile-card-demo |
| legacy.example.local | legacy-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.localStudio Oasis
Identifier:
studio-oasisCustom domain: studio.example.localAvery Stone
Identifier:
profile-card-demoCustom domain: card.example.localAvery Studio Showcase
Identifier:
profile-card-showcase-demoNora Atelier
Identifier:
legacy-public-demoCustom domain: legacy.example.localHow to test custom domains locally (Windows)
1. Open the Windows hosts file as administrator:
C:\Windows\System32\drivers\etc\hosts2. Add these lines at the bottom:
127.0.0.1 maya.example.local 127.0.0.1 studio.example.local
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. Or test with curl (no hosts file needed):
curl -H "Host: maya.example.local" http://localhost:3001/