Repository navigation
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
117 lines (115 loc) · 4.68 KB
/
Copy pathwrangler.jsonc
File metadata and controls
117 lines (115 loc) · 4.68 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
"$schema": "node_modules/wrangler/config-schema.json",
// Not `meteocool`: that is the account's existing production Worker, and a
// bare `wrangler deploy` with this name would overwrite it. Every env below
// names itself.
"name": "meteocool-web",
"main": "./worker/index.ts",
"compatibility_date": "2026-09-01",
// `run_worker_first` is what makes the OpenGraph injection possible at all:
// without it Cloudflare serves index.html straight from the asset store and
// the Worker never sees the request.
//
// No `not_found_handling`: this is a multi-page build (index, ios, android,
// imprint, privacy), not an SPA, so a missing asset should 404 rather than be
// rewritten to index.html.
//
// `html_handling: "none"`: by default Cloudflare 307s /ios.html to /ios. The
// iOS and Android wrappers load ios.html and android.html by name, so those
// URLs have to keep resolving directly.
"assets": {
"directory": "./dist",
"binding": "ASSETS",
"run_worker_first": true,
"html_handling": "none",
},
// Three environments, one per Worker and Vite mode: `production` from
// `main`, `next` and `demo` from `develop` (.github/workflows). Build each
// with its own `--mode`, as its deploy script does; production's is Vite's
// default.
//
// A custom domain belongs to one Worker at a time, and a deploy from CI
// takes it over without asking. Never list a hostname in two environments,
// or each deploy steals it back from the other.
//
// In each: API_ORIGIN is where the apps' API calls are forwarded, and
// DATA_ORIGIN and ASSET_ORIGIN what the iOS app's AR view reads through the
// Worker (worker/api.ts). PREVIEW_ORIGIN names the API whose preview cards
// the OpenGraph tags advertise: the Worker is bundled by wrangler, so Vite's
// `--mode` never reaches it. The preview Worker is bound as a service rather
// than fetched, which from a Worker in the same zone would skip its route.
"env": {
// meteocool.com, and app.meteocool.com, where the native apps load their
// map and send their push registrations. Its backend is production's,
// the Flanders cluster (meteocool/ng, doc/flanders.md), on production's
// own hostnames; next and demo below share the staging cluster.
"production": {
"name": "meteocool-production",
"compatibility_date": "2026-09-20",
"logpush": true,
"workers_dev": false,
"routes": [
{ "pattern": "meteocool.com", "custom_domain": true },
{ "pattern": "app.meteocool.com", "custom_domain": true },
],
"observability": {
"enabled": true,
"logs": { "enabled": true },
"traces": { "enabled": true },
},
"vars": {
"PREVIEW_ORIGIN": "https://api.meteocool.com",
"API_ORIGIN": "https://api.meteocool.com",
"DATA_ORIGIN": "https://data.meteocool.com",
"ASSET_ORIGIN": "https://assets.meteocool.com",
},
// Production's own preview-edge Worker (ng infra/terraform/cloudflare/flanders.tf),
// which renders meteocool.com.
"services": [{ "binding": "PREVIEW", "service": "meteocool-preview-flanders" }],
},
// next.meteocool.com: what develop holds, on the live feeds.
"next": {
"name": "meteocool-next",
"compatibility_date": "2026-09-20",
"logpush": true,
"workers_dev": true,
"routes": [
{ "pattern": "next.meteocool.com", "custom_domain": true },
],
"observability": {
"enabled": true,
"logs": { "enabled": true },
"traces": { "enabled": true },
},
"vars": {
"PREVIEW_ORIGIN": "https://api-next.meteocool.com",
"API_ORIGIN": "https://api-next.meteocool.com",
"DATA_ORIGIN": "https://data-staging.meteocool.com",
"ASSET_ORIGIN": "https://assets-staging.meteocool.com",
},
"services": [{ "binding": "PREVIEW", "service": "meteocool-preview" }],
},
// demo.meteocool.com: develop again, on a backend replaying a recorded storm.
"demo": {
"name": "meteocool-demo",
"compatibility_date": "2026-09-20",
"logpush": true,
"workers_dev": true,
"routes": [
{ "pattern": "demo.meteocool.com", "custom_domain": true },
],
"observability": {
"enabled": true,
"logs": { "enabled": true },
"traces": { "enabled": true },
},
"vars": {
"PREVIEW_ORIGIN": "https://api-demo.meteocool.com",
"API_ORIGIN": "https://api-demo.meteocool.com",
"DATA_ORIGIN": "https://data-demo.meteocool.com",
"ASSET_ORIGIN": "https://assets-demo.meteocool.com",
},
"services": [{ "binding": "PREVIEW", "service": "meteocool-preview" }],
},
},
}