@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 20 lines 674 Bytes
Raw
1 import { Schema, pipe } from "effect";
2 import { Route } from "foldkit";
3 import { defineRouteUnion, literal } from "foldkit/route";
4
5 export const AppRoute = defineRouteUnion({
6 Home: {},
7 About: {},
8 NotFound: { path: Schema.String },
9 });
10
11 export type AppRoute = typeof AppRoute.Type;
12
13 export const homeRouter = pipe(Route.root, Route.mapTo(AppRoute.Home));
14 export const aboutRouter = pipe(literal("about"), Route.mapTo(AppRoute.About));
15
16 export const prerenderPaths: ReadonlyArray<string> = [homeRouter(), aboutRouter()];
17
18 const routeParser = Route.oneOf(aboutRouter, homeRouter);
19
20 export const urlToAppRoute = Route.parseUrlWithFallback(routeParser, AppRoute.NotFound);