forked from Mike/freno-dev
nook: dispatch /agents, /changelog and /faq at the top level
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
This commit is contained in:
24
src/routes/agents.tsx
Normal file
24
src/routes/agents.tsx
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { Switch, Match } from "solid-js";
|
||||||
|
import { useSite } from "~/context/SiteContext";
|
||||||
|
import NotFound from "./[...404]";
|
||||||
|
import NookAgentsPage from "./nook/agents";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Host-aware agents route — `/agents`.
|
||||||
|
*
|
||||||
|
* The supported-agents page 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` — and like them, this is what makes the
|
||||||
|
* page render at all: production does not apply the vercel.json host
|
||||||
|
* rewrites (SSR sees `/agents`, never `/nook/agents`).
|
||||||
|
*/
|
||||||
|
export default function AgentsPage() {
|
||||||
|
const site = useSite();
|
||||||
|
return (
|
||||||
|
<Switch fallback={<NotFound />}>
|
||||||
|
<Match when={site().id === "nook"}>
|
||||||
|
<NookAgentsPage />
|
||||||
|
</Match>
|
||||||
|
</Switch>
|
||||||
|
);
|
||||||
|
}
|
||||||
23
src/routes/changelog.tsx
Normal file
23
src/routes/changelog.tsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { Switch, Match } from "solid-js";
|
||||||
|
import { useSite } from "~/context/SiteContext";
|
||||||
|
import NotFound from "./[...404]";
|
||||||
|
import NookChangelogPage from "./nook/changelog";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Host-aware changelog route — `/changelog`.
|
||||||
|
*
|
||||||
|
* The release-notes page 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 `/changelog`, never `/nook/changelog`).
|
||||||
|
*/
|
||||||
|
export default function ChangelogPage() {
|
||||||
|
const site = useSite();
|
||||||
|
return (
|
||||||
|
<Switch fallback={<NotFound />}>
|
||||||
|
<Match when={site().id === "nook"}>
|
||||||
|
<NookChangelogPage />
|
||||||
|
</Match>
|
||||||
|
</Switch>
|
||||||
|
);
|
||||||
|
}
|
||||||
23
src/routes/faq.tsx
Normal file
23
src/routes/faq.tsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
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>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user