feat: add subdomain-based site context with SSR resolution

Resolve the active site from the request Host header on the server and
expose it through a SiteContext provider so the app can vary rendering
per subdomain. Serialize the resolved site into the document shell
(data-site attribute + window.__SITE__) so client hydration matches the
server render. Add host-based Vercel rewrites mapping each subdomain to
its site root, and include unit tests for the site resolution logic.
This commit is contained in:
2026-07-23 09:18:55 -04:00
parent 0385090f32
commit 92890ce259
7 changed files with 552 additions and 35 deletions

View File

@@ -1,4 +1,30 @@
{
"rewrites": [
{
"source": "/api/(.*)",
"has": [{ "type": "host", "value": "gaze.freno.me" }],
"destination": "/api/$1"
},
{
"source": "/api/(.*)",
"has": [{ "type": "host", "value": "inputhalo.freno.me" }],
"destination": "/api/$1"
},
{
"source": "/api/(.*)",
"has": [{ "type": "host", "value": "nessa.freno.me" }],
"destination": "/api/$1"
},
{
"source": "/api/(.*)",
"has": [{ "type": "host", "value": "lineage.freno.me" }],
"destination": "/api/$1"
},
{ "source": "/(.*)", "has": [{ "type": "host", "value": "nessa.freno.me" }], "destination": "/nessa/$1" },
{ "source": "/(.*)", "has": [{ "type": "host", "value": "lineage.freno.me" }], "destination": "/lineage/$1" },
{ "source": "/(.*)", "has": [{ "type": "host", "value": "gaze.freno.me" }], "destination": "/gaze/$1" },
{ "source": "/(.*)", "has": [{ "type": "host", "value": "inputhalo.freno.me" }], "destination": "/inputhalo/$1" }
],
"headers": [
{
"source": "/",