Skip to content

Commit fbc78d6

Browse files
authoredNov 13, 2024
Switch to routes.ts (#130)
* Upgrade Remix to 2.14.0-pre.0 * Move route definitions to routes.ts * Remove @remix-run/routes-option-adapter * Bump to 2.14.0 * Update routes to match update after removed api routes
1 parent a7d1c0d commit fbc78d6

File tree

4 files changed

+178
-602
lines changed

4 files changed

+178
-602
lines changed
 

‎app/routes.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { type RouteConfig, route, index } from "@remix-run/route-config";
2+
3+
export const routes: RouteConfig = [
4+
index("pages/splash.tsx"),
5+
route("/brand", "pages/brand.tsx"),
6+
route("/healthcheck", "pages/healthcheck.tsx"),
7+
route("/color-scheme", "actions/color-scheme.ts"),
8+
9+
route("/:ref?", "pages/docs-layout.tsx", { id: "docs" }, [
10+
index("pages/docs-index.tsx"),
11+
route("home", "pages/doc.tsx", { id: "home" }),
12+
route("*", "pages/doc.tsx"),
13+
]),
14+
15+
route("/*", "pages/notfound.tsx"),
16+
17+
// short version URLs for changelogs and stuff
18+
route("/v6/*", "pages/redirect-v6-doc.tsx"),
19+
route("/v7/*", "pages/redirect-v7-doc.tsx"),
20+
21+
// v6 URLs before the api reference docs
22+
route("/en/:ref", "pages/docs-layout.tsx", { id: "v6-docs" }, [
23+
index("pages/docs-home.tsx", {
24+
id: "v6-index",
25+
}),
26+
route("*", "pages/doc.tsx", { id: "v6-guide" }),
27+
]),
28+
];
29+
30+
if (process.env.NODE_ENV === "development") {
31+
routes.push(route("/__playground", "components/_playground/playground.tsx"));
32+
}

0 commit comments

Comments
 (0)