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:
26
vercel.json
26
vercel.json
@@ -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": "/",
|
||||
|
||||
Reference in New Issue
Block a user