forked from Mike/freno-dev
The new subdomain pages 404ed in production: the vercel.json host rewrites do not fire — SSR sees /agents, never /nook/agents — so pages that only exist under src/routes/nook/* are unreachable from the subdomain. Every pre-existing subdomain surface survives on top-level host-dispatch routes (index, privacy, checkout, deletion), which is why only the new pages broke. Give the three pages the same dispatch, falling back to 404 on other sites. Tests: full bun test run unchanged (539 pass); vinxi build clean. Issue: FRE-12
24 lines
690 B
TypeScript
24 lines
690 B
TypeScript
import { Switch, Match } from "solid-js";
|
|
import { useSite } from "~/context/SiteContext";
|
|
import NotFound from "./[...404]";
|
|
import NookFaqPage from "./nook/faq";
|
|
|
|
/**
|
|
* Host-aware FAQ route — `/faq`.
|
|
*
|
|
* The FAQ is a Nook-subdomain surface; all other sites fall back to 404.
|
|
* Mirrors the dispatch pattern in `src/routes/index.tsx` and
|
|
* `src/routes/checkout.tsx` — production does not apply the vercel.json
|
|
* host rewrites (SSR sees `/faq`, never `/nook/faq`).
|
|
*/
|
|
export default function FaqPage() {
|
|
const site = useSite();
|
|
return (
|
|
<Switch fallback={<NotFound />}>
|
|
<Match when={site().id === "nook"}>
|
|
<NookFaqPage />
|
|
</Match>
|
|
</Switch>
|
|
);
|
|
}
|