From 91cb4d08a7090307411a98d81d8342661e3db742 Mon Sep 17 00:00:00 2001 From: navin10sharma <3096611+navin10sharma@users.noreply.github.com> Date: Sat, 26 Sep 2026 09:10:16 +0530 Subject: [PATCH 1/2] README: hosting runs on Workers static assets, not Pages --- README.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d3611d7..c4f6db0 100644 --- a/README.md +++ b/README.md @@ -231,15 +231,20 @@ countdown. ## Hosting on Cloudflare -The build output in `dist` is a static site, so it runs on Cloudflare Pages as -it is. Use `npm run build` as the build command and `dist` as the output -directory. Set the `VITE_` variables as build variables, because Vite writes -them into the bundle at build time. - -The routes are handled in the browser by React Router. Pages serves -`index.html` for any path that is not a file when the site has no top level -`404.html`, so deep links such as `/seat-picker` work without a `_redirects` -file. +The build output in `dist` is a static site, served on Cloudflare Workers as +static assets. `wrangler.jsonc` sets it up: + +```sh +npm run build +npx wrangler deploy +``` + +Set the `VITE_` variables before `npm run build`, because Vite writes them into +the bundle at build time. + +The routes are handled in the browser by React Router. `wrangler.jsonc` sets +`not_found_handling` to `single-page-application`, so a deep link such as +`/seat-picker` serves `index.html` and the app takes it from there. Add `?embed=1` to any route to hide the navigation and the route heading, so the example sits cleanly in an iframe. From 391ff160cf55141f29cdc2a5f1132549970d7043 Mon Sep 17 00:00:00 2001 From: navin10sharma <3096611+navin10sharma@users.noreply.github.com> Date: Sat, 26 Sep 2026 09:34:40 +0530 Subject: [PATCH 2/2] Fork-safe Worker config: generic default, our copy in env hosted The default deploys a Worker named seatlayer-react-example with no custom domain. The hosted environment keeps our name (seatlayer-examples-react) and examples-react.seatlayer.io. --- README.md | 16 ++++++++++++++++ wrangler.jsonc | 14 +++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c4f6db0..285683b 100644 --- a/README.md +++ b/README.md @@ -246,6 +246,22 @@ The routes are handled in the browser by React Router. `wrangler.jsonc` sets `not_found_handling` to `single-page-application`, so a deep link such as `/seat-picker` serves `index.html` and the app takes it from there. +`npx wrangler deploy` creates your own Worker named `seatlayer-react-example`, +with no custom domain. Rename it in `wrangler.jsonc` if you like. + +### Hosting our copy + +The live demo at examples-react.seatlayer.io is this repository deployed with +the `hosted` environment in `wrangler.jsonc`, which sets the Worker name +`seatlayer-examples-react` and the custom domain: + +```sh +npm run build +npx wrangler deploy --env hosted +``` + +You do not need this environment for your own copy. + Add `?embed=1` to any route to hide the navigation and the route heading, so the example sits cleanly in an iframe. diff --git a/wrangler.jsonc b/wrangler.jsonc index 5215cf1..8e99ff3 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -1,12 +1,20 @@ { - // Hosted copy of this example on Cloudflare Workers static assets. + // This example on Cloudflare Workers static assets. // Build first (npm run build), then deploy with: npx wrangler deploy + // That deploys your own copy under the name below, with no custom domain. + // The "hosted" environment is the SeatLayer copy on + // examples-react.seatlayer.io; you do not need it. "$schema": "node_modules/wrangler/config-schema.json", - "name": "seatlayer-examples-react", + "name": "seatlayer-react-example", "compatibility_date": "2026-09-01", "assets": { "directory": "./dist", "not_found_handling": "single-page-application" }, - "routes": [{ "pattern": "examples-react.seatlayer.io", "custom_domain": true }] + "env": { + "hosted": { + "name": "seatlayer-examples-react", + "routes": [{ "pattern": "examples-react.seatlayer.io", "custom_domain": true }] + } + } }