site/wrangler.jsonc puts site/dist/ behind bench.12vectors.com as static
assets. No `main`: the site is files, and a Worker with no script is the
cheapest correct way to serve them.
html_handling force-trailing-slash, so /x redirects to /x/ — the
url the pages link and rel=canonical names. One
page, one address; no url ends in .html.
not_found_handling 404-page, so an unknown path gets dist/404.html
with a 404 status rather than the landing page
with a 200.
routes bench.12vectors.com as a custom domain. Cloudflare
takes the hostname at the zone level and makes the
DNS record; nothing else on 12vectors.com moves.
site/root/_headers carries the response policy. HTML revalidates on
every view, so a deploy is visible on the next reload without anyone
clearing a cache; /static/* is kept for a year and never re-checked,
which is safe because the stylesheet and icon urls carry a hash of their
contents. The general rule is written first and the specific one second,
so a host that merged the two instead of overriding would still land on
max-age=0 — the safe side. Alongside it the baseline a public page owes:
nosniff, a referrer policy, a year of HSTS without preload,
X-Frame-Options, and a default-src 'none' CSP that makes "no analytics,
no third-party anything" something the browser enforces rather than
something a test asserted once.
Deploys are run by hand, as releases already are — no Cloudflare token
in repository secrets, no first deploy pipeline. site/README.md names
the account, the Worker, the route and the four-command sequence, plus
the four things to check after a deploy that no test here can reach.
The tests cover everything before Cloudflare: that the config says what
the site needs, that the build writes the files it names, and that
wrangler.jsonc, pages.json and README.md cannot drift apart about which
domain this is. A live response is not among them.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
44 lines
1.7 KiB
JSON
44 lines
1.7 KiB
JSON
// bench.12vectors.com — the built minisite, served as static assets.
|
|
//
|
|
// There is no `main`: this Worker has no script at all. site/dist/ is
|
|
// plain files and Cloudflare's static-assets router serves them, so the
|
|
// cheapest correct thing is to give it nothing to run. Anything that
|
|
// would need a fetch handler (an api, a redirect that depends on state)
|
|
// is a different card.
|
|
//
|
|
// npx wrangler@4 deploy --config site/wrangler.jsonc
|
|
//
|
|
// See site/README.md for the whole sequence, the account, and what the
|
|
// domain currently points at.
|
|
{
|
|
"name": "bench-site",
|
|
"compatibility_date": "2026-07-01",
|
|
|
|
"assets": {
|
|
// Relative to this file. site/build.py writes it; it is gitignored,
|
|
// so a deploy from a clean checkout builds first.
|
|
"directory": "./dist",
|
|
|
|
// /concepts/claiming-a-card -> 301 -> /concepts/claiming-a-card/,
|
|
// which is the url the pages link and the one <link rel=canonical>
|
|
// names. One page, one address: the slashless form redirects rather
|
|
// than serving a second copy, and no url ever ends in .html.
|
|
"html_handling": "force-trailing-slash",
|
|
|
|
// An unknown path gets dist/404.html with a 404 status — the site's
|
|
// own not-found page, in the site's own design. Not "single-page-
|
|
// application", which would answer 200 with the landing page and
|
|
// tell a crawler every typo is a real url.
|
|
"not_found_handling": "404-page"
|
|
},
|
|
|
|
// The hostname, taken over at the zone level: Cloudflare points
|
|
// bench.12vectors.com at this Worker and creates the DNS record. It
|
|
// touches nothing else on 12vectors.com.
|
|
"routes": [
|
|
{ "pattern": "bench.12vectors.com", "custom_domain": true }
|
|
],
|
|
|
|
"observability": { "enabled": true }
|
|
}
|