-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
63 lines (63 loc) · 3.55 KB
/
Copy pathwrangler.jsonc
File metadata and controls
63 lines (63 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Cloudflare Workers config. There is no database, no KV, and no auth binding:
// the registry JSON is the source of truth, it lives in git, and it ships as
// static assets on the same deploy as the code — so there is no second store
// that can disagree with the version that rendered the page.
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "dsh-works-plugins",
"compatibility_date": "2026-02-12",
"compatibility_flags": ["nodejs_compat"],
"main": "vinext/server/app-router-entry",
"assets": {
// The Worker renders every HTML route, so an unmatched asset path must
// fall through to it rather than 404 at the edge.
"not_found_handling": "none",
"binding": "ASSETS"
},
// The Worker owns the apex front door and its own paths. It does NOT own the
// whole hostname, and that is not timidity — dshworks.github.io/* 301s to
// dsh.works/*, so a Worker holding every path could not proxy the GitHub
// Pages project sites without looping into itself. Verified, not assumed.
//
// Unlisted paths never reach the Worker and go straight to the Pages origin
// through the proxied A records, so /awesome-dsh-plugins/, /awesome-dsh-themes/,
// /dsh-meter/ and /dsh-crew/ keep serving exactly what they served before.
//
// /assets/* and /_data/* are the Worker's own bundles and data; both were 404
// at the apex before this, so nothing is taken.
// A pattern is matched against the WHOLE url, query string included, so
// "dsh.works/" matches only the bare root — dsh.works/?utm_source=x fell
// through to the Pages 404 page. Anything not already ending in * gets a
// query-tolerant twin. Found by cache-busting a request and getting the old
// site back, which is the polite version of finding it in production.
"routes": [
// Cloudflare matches a route against the whole URL, query string included,
// so `dsh.works/` alone does not catch `dsh.works/?utm_source=hn` — which
// is how a shared link actually arrives. The obvious patch, `dsh.works/?*`,
// is rejected by the API outright ("Route pattern should not have query
// parameters", 10022); it used to be accepted and silently dropped, which
// was worse. There is no route syntax that fixes this.
//
// A greedy `dsh.works/*` would fix it and take the five GitHub Pages
// project sites with it, and the Worker cannot proxy those back: the
// github.io origin 301s to dsh.works for every path, so forwarding loops.
//
// So the split stands, and the fallback page the query-string root lands on
// carries this site's real metadata and forwards to the bare root. See
// dshworks.github.io/index.html.
{ "pattern": "dsh.works/", "zone_name": "dsh.works" },
{ "pattern": "dsh.works/p/*", "zone_name": "dsh.works" },
{ "pattern": "dsh.works/tag/*", "zone_name": "dsh.works" },
{ "pattern": "dsh.works/api/*", "zone_name": "dsh.works" },
{ "pattern": "dsh.works/assets/*", "zone_name": "dsh.works" },
{ "pattern": "dsh.works/_data/*", "zone_name": "dsh.works" },
{ "pattern": "dsh.works/llms.txt*", "zone_name": "dsh.works" },
{ "pattern": "dsh.works/sitemap.xml*", "zone_name": "dsh.works" },
// The seats link here. Because the Worker owns paths rather than the
// hostname, a page that is not on this list never reaches it and falls
// through to the Pages origin as a 404 — which is exactly what /sponsor
// did on its first deploy, with four gold boxes pointing at it.
{ "pattern": "dsh.works/sponsor*", "zone_name": "dsh.works" }
],
"observability": { "enabled": true }
}