1.3 KiB
1.3 KiB
ECP-0044: Cloudflare Workers Static Site Deployment
Why
We want a fast, globally cached, no-backend website at every.channel that:
- serves the viewer UI (PWA-capable),
- can be deployed reproducibly from this repo,
- does not require a centralized application server.
Cloudflare Workers + static Assets gives us:
- global edge caching and TLS,
- a simple deploy story (
wrangler deploy), - the option to add small edge logic later (redirects, headers, SPA fallback).
Proposal
- Treat
apps/tauri/uias the canonical website source (Dioxus web build). - Treat
apps/tauri/distas the deployment artifact. - Add a Cloudflare Worker project under
deploy/cloudflare-worker/that servesapps/tauri/dist. - Implement SPA fallback: if an asset path 404s, serve
/index.html. - Keep deployment logic in a script:
- build:
trunk build --release - deploy:
wrangler deploy
- build:
Scope (initial)
- One worker that only serves static assets + SPA fallback.
- No API, no auth, no server-side state.
- Domain mapping to
every.channelis declared inwrangler.tomlvia Workers Custom Domains.- This requires appropriate Cloudflare account permissions for
wrangler deployto attach the domain.
- This requires appropriate Cloudflare account permissions for
Reversibility
High. The worker is a thin wrapper over static assets. We can migrate to Pages, another CDN, or self-hosted static with minimal changes.