-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathwrangler.toml
More file actions
47 lines (43 loc) · 2.3 KB
/
Copy pathwrangler.toml
File metadata and controls
47 lines (43 loc) · 2.3 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
# Cloudflare Workers static-assets deployment for the static.polygon.technology
# HTTP endpoint. Cloudflare serves the assembled dist/ bundle (network/ JSON
# tree + health-check index.html + _headers) directly from its edge; the tiny
# worker script exists only because the asset layer serves GET/HEAD and 405s
# every other method — including the OPTIONS preflights browsers send for
# maticjs's Content-Type-bearing GETs (see worker/worker.ts). The npm package
# (@polygonlabs/meta, packages/meta/) is a separate surface with its own
# release pipeline; both are generated from the same network/ tree.
name = "polygon-static"
main = "worker/worker.ts"
compatibility_date = "2026-06-24"
placement = { mode = "smart" }
workers_dev = false
preview_urls = false
send_metrics = false
[assets]
directory = "./dist"
# Missing paths return a real 404: this is a JSON store consumed by SDKs, not an
# SPA — an index.html fallback would mask missing files as 200+HTML.
not_found_handling = "none"
# Lets the worker delegate non-OPTIONS requests back to the asset layer.
binding = "ASSETS"
# Required for the worker to see OPTIONS at all: without it the asset layer
# answers non-GET/HEAD on asset-matched paths itself (405) — verified with
# `wrangler dev`; the docs' "other methods route to the Worker" doesn't hold
# for matched paths. GET/HEAD delegated via the binding still get _headers
# and not_found_handling applied.
run_worker_first = true
[build]
command = "pnpm run build:cdn"
# Staging tracks trunk: every push to master deploys here. static-staging's
# DNS record predates this worker (externally managed), so until SPEC swaps it
# onto the polygon-static-staging worker in the CF dashboard, a staging deploy
# fails harmlessly at the domain-registration step (code 100117) — same
# sequence as the apex cutover; see the service-hosting-migration runbook.
[env.staging]
routes = [{ pattern = "static-staging.polygon.technology", custom_domain = true }]
# Apex. Deploys on the @polygonlabs/meta release tag, in lockstep with the npm
# publish. If this hostname ever needs to move to another platform, follow the
# team's internal service-hosting-migration runbook — wrangler cannot rebind a
# hostname whose DNS record already exists elsewhere.
[env.production]
routes = [{ pattern = "static.polygon.technology", custom_domain = true }]