Skip to content

Host the example on Cloudflare Pages: embed mode, CI route checks - #3

Merged
pietechsolution merged 3 commits into
mainfrom
feat/hosted-demo
Sep 26, 2026
Merged

pietechsolution merged 3 commits into
mainfrom
feat/hosted-demo

Conversation

@pietechsolution

Copy link
Copy Markdown
Contributor

Prepares the example to run as a hosted demo on Cloudflare Pages and to be embedded in documentation pages.

Changes

  • ?embed=1. Set once in src/App.tsx: the layout route reads the query string, drops the navigation and adds an embed class that hides the route heading. Works on every route.
  • Cloudflare Pages. No config file is needed. The routes are client side (React Router BrowserRouter), and Pages already serves index.html for any path that is not a file when the build has no top level 404.html. A public/_redirects with /* /index.html 200 was tried and dropped: Wrangler rejects it as an infinite loop rule and ignores it. Build command npm run build, output directory dist, VITE_ variables set as build variables. Documented in a new "Hosting on Cloudflare" README section at the end.
  • CI route checks. CI still builds every push. When the DEMO_EVENT_KEY and DEMO_PUBLIC_KEY repository secrets exist (optional DEMO_SEASON_KEY), it serves the build with npm run preview and runs scripts/check-routes.mjs, which loads every route with and without ?embed=1 in Chromium and fails on an HTTP error, an uncaught exception, a console error, or a visible navigation in embed mode. Forks without the secrets only build.
  • Empty optional event keys. An empty VITE_SEATLAYER_EVENT_KEY_2 / _3 (as in a copied .env.example) now falls back to the main key instead of producing an empty key.
  • The events list is client side configuration with no server, so there is no account-wide listing to change.

Verification

  • npm ci && npm run build.
  • vite preview without keys: scripts/check-routes.mjs passes on all 12 route and embed combinations (setup notices, no console errors, navigation hidden with ?embed=1).
  • wrangler pages dev dist: /, /seat-picker, /events?embed=1, /control-room and an unknown path all return index.html with 200, and the route check passes against it.

Nothing was deployed.

Held: merge when the hosted demo is ready.

@pietechsolution
pietechsolution merged commit 828bea1 into main Sep 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants