Skip to content

Commit ff6ce76

Browse files
MajorTalclaude
andcommitted
docs: add run402.config.example.json (site + assets + functions atomic apply)
Paste-and-go example carrying every top-level ReleaseSpec slice — database (migrations + expose), secrets.require, functions.replace, site.replace, assets.put with an immutable image, assets.sync.prune scaffold, subdomains.set, routes.replace. The $schema link points at https://run402.com/schemas/release-spec.v1.json so JSON-Schema-aware editors validate the shape inline. Closes unified-apply §7.6. See run402-private/CLAUDE.md 'Unified apply asset slice + sync-prune confirmation — v1.48' for the prune-confirmation flow that the example's placeholder `assets.sync.confirm` block points at. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2431edb commit ff6ce76

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

run402.config.example.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"$schema": "https://run402.com/schemas/release-spec.v1.json",
3+
"project_id": "prj_REPLACE_ME",
4+
"base": { "release": "current" },
5+
6+
"database": {
7+
"migrations": [
8+
{
9+
"id": "001_init",
10+
"sql": "CREATE TABLE IF NOT EXISTS items (id bigserial PRIMARY KEY, title text NOT NULL, created_at timestamptz NOT NULL DEFAULT NOW());"
11+
}
12+
],
13+
"expose": {
14+
"version": "1",
15+
"tables": [{ "name": "items", "expose": true, "policy": "public_read_authenticated_write" }]
16+
}
17+
},
18+
19+
"secrets": {
20+
"require": ["OPENAI_API_KEY"]
21+
},
22+
23+
"functions": {
24+
"replace": {
25+
"api": {
26+
"runtime": "node22",
27+
"source": {
28+
"data": "ZXhwb3J0IGRlZmF1bHQgYXN5bmMgKHJlcSkgPT4gbmV3IFJlc3BvbnNlKEpTT04uc3RyaW5naWZ5KHsgb2s6IHRydWUgfSksIHsgaGVhZGVyczogeyAiY29udGVudC10eXBlIjogImFwcGxpY2F0aW9uL2pzb24iIH0gfSk7",
29+
"encoding": "base64",
30+
"contentType": "text/javascript"
31+
},
32+
"config": { "timeoutSeconds": 30, "memoryMb": 256 }
33+
}
34+
}
35+
},
36+
37+
"site": {
38+
"replace": {
39+
"index.html": {
40+
"data": "PCFkb2N0eXBlIGh0bWw+CjxodG1sPgo8aGVhZD48dGl0bGUgPmhlbGxvPC90aXRsZT48L2hlYWQ+Cjxib2R5PgogIDxoMT5oZWxsbzwvaDE+CiAgPHNjcmlwdCBzcmM9Ii9zdGF0aWMvYXBwLmpzIj48L3NjcmlwdD4KPC9ib2R5Pgo8L2h0bWw+Cg==",
41+
"encoding": "base64",
42+
"contentType": "text/html; charset=utf-8"
43+
}
44+
},
45+
"public_paths": { "mode": "implicit" }
46+
},
47+
48+
"assets": {
49+
"put": [
50+
{
51+
"key": "static/app.js",
52+
"source": "console.log('hello from app.js');\n",
53+
"content_type": "text/javascript",
54+
"visibility": "public",
55+
"immutable": true
56+
}
57+
],
58+
"delete": [],
59+
"sync": {
60+
"prefix": "static/",
61+
"prune": true,
62+
"confirm": {
63+
"base_revision": "REPLACE_WITH_SHA256_FROM_PRIOR_PLAN",
64+
"delete_set_digest": "REPLACE_WITH_SHA256_FROM_PRIOR_PLAN",
65+
"expected_delete_count": 0
66+
}
67+
}
68+
},
69+
70+
"subdomains": { "set": ["my-app"] },
71+
72+
"routes": {
73+
"replace": [
74+
{ "pattern": "/api/*", "methods": ["GET", "POST"], "target": { "type": "function", "name": "api" } }
75+
]
76+
}
77+
}

0 commit comments

Comments
 (0)