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

main
md 43 lines 1.81 KB
Rendered Raw
1 # cloudflare-foldkit-ssg
2
3 The routed scaffold from `create-foldkit-app --rendering ssg`.
4 Foldkit prerenders `/` and `/about` during `vite build`. Cloudflare serves those
5 HTML files from its asset layer, and `Runtime.hydrate` makes them interactive.
6 The server entry limits the app to those two routes; unknown pages return 404.
7
8 ## Run on Cloudflare
9
10 From this directory, after installing the workspace dependencies:
11
12 ```sh
13 pnpm dev
14 pnpm deploy
15 pnpm destroy
16 ```
17
18 `pnpm build` runs the standard Vite build. `pnpm test` runs the credentialed
19 Cloudflare integration checks and destroys the example afterward.
20
21 `alchemy.run.ts` uses `Cloudflare.Website.Foldkit`. The application’s Vite plugin
22 supplies the build output and routing metadata; no hand-written Worker wrapper
23 or build identity declaration is required.
24
25 ## Scaffold source
26
27 Application files follow [Foldkit’s generator and examples](https://github.com/foldkit/foldkit/tree/foldkit%400.167.0/packages/create-foldkit-app/templates/rendering/ssg)
28 (Foldkit 0.167.0 / `create-foldkit-app` 0.39.0). The original files were produced using the
29 generator’s `createProject` function. Alchemy adds the deployment file, workspace
30 package configuration and integration tests.
31
32 ## Rendering examples
33
34 - [SPA / CSR](../cloudflare-foldkit-spa): browser-only counter.
35 - [SSG](../cloudflare-foldkit-ssg): prerendered home and about pages.
36 - [SSR](../cloudflare-foldkit-ssr): cookie-backed request rendering.
37 - [Hybrid](../cloudflare-foldkit-hybrid): prerendered pages and a dynamic counter.
38
39 SSR/SSG documents follow the 0.167 scaffold: CSS is imported by the client entry,
40 and the server exports `renderDocument`. There is no source `index.html`.
41
42 `src/route.ts` defines the application routers and derives `prerenderPaths` from
43 them. Both browser navigation and the server use those route definitions.