worker
The Cloudflare Worker, whiskers-web. It serves one page and the few things the page asks for,
keeps nothing and asks nobody anything.
| Route | What |
|---|---|
GET / | The page. ?mascot=ginger|grey|bunny pre-selects who is on stage; a value that is not a mascot is Ginger. |
GET /cat.css, /favicon.svg, /robots.txt | Its files. The stylesheet is the cat's keyframes, named by content and cached for good. |
GET /ui.css, /ui.js, /datastar.js, /fonts/* | The shared look's files, from jev-ui's embedded bytes (jev_ui::asset); a request carrying the right ?v= is cached for good. |
POST /mood, /mascot, /tick, /tour | The demo: Datastar posts the page's signals; the answer is the cat, its caption, the stages it is busy with, the mood pills (the one the tour is on carries an hourglass and a countdown bar) and the tour button, as HTML to morph in, and new signals. On load the page posts /tour once (unless the visitor asked for less motion) so the server starts the tour. |
/preview/card.png | A static asset built by ../tools/preview, served by Cloudflare before this code runs. |
/preview/loop.mp4 | The link preview's video, built the same way but run through the Worker first (run_worker_first) so it answers byte ranges (Accept-Ranges, 206, 416), which Discord, Twitter and iOS rely on and static assets do not give. It is read through the ASSETS binding and sliced in src/media.rs; which bytes is site::range. |
Every response carries a strict Content-Security-Policy (nothing from elsewhere), and HTML says
no-transform so Cloudflare does not add its analytics script. Invocation logs are off.
Run it as described in ../README.md. wrangler.toml holds the route
whiskers.lmjtfy.fun as a Workers custom domain (workers.dev stays on too); it is inert until someone deploys.
| Path | What |
|---|---|
| src/ | The code. |
| wrangler.toml | The Worker's configuration, route and asset directory. |
public/preview/ | Generated, gitignored: the preview files. |