@@ -61,3 +61,47 @@ pgpm docker start --image docker.io/constructiveio/postgres-plus:18
6161eval " $( pgpm env) "
6262pnpm --filter " @constructive-functions/feature-____name____" test
6363```
64+
65+ ## Next
66+
67+ The test above is the loop: it clones a seeded template database, needs no
68+ cluster, and is the only thing you need while writing the handler. When you want
69+ this feature on a real stack, from the root of the checkout it lives in:
70+
71+ ``` bash
72+ pnpm fun up --k8s # brings the platform up and registers every feature here
73+ ```
74+
75+ Registration reads ` handlers/handler.json ` — the same file the test reads — so a
76+ manifest-only change needs no rebuild:
77+
78+ ``` bash
79+ pnpm fun register --apply # write the declaration; --dry-run prints the SQL
80+ ```
81+
82+ A registration failure aborts the bring-up rather than being reported as
83+ skipped, which it once was: an unregistered method has no symptom of its own
84+ until something calls it and gets
85+ ` No service URL for "____name____:____method____" ` .
86+
87+ ### If this is a page
88+
89+ A page method is ` accessChannels: ["page"] ` plus a ` route ` , and that is the whole
90+ of it: no framework, no build step, no ` pages/ ` directory — the handler answers
91+ with the status, headers and body the browser gets.
92+
93+ A feature that serves a * site* rather than one route puts those methods in a
94+ second manifest nested beside this one, because a page container and a JSON
95+ container are two images:
96+
97+ ```
98+ handlers/handler.json the sync/job methods "type": "node-multi-method"
99+ handlers/pages/handler.json the routes a browser lands on "type": "node-page"
100+ ```
101+
102+ The nested manifest declares its own ` image ` , and the platform generates and
103+ builds it as one. ` features/auth ` in constructive-functions is the reference —
104+ one page image serving four landings, each redirecting with the tenant's session
105+ cookie. Note that ` route ` and ` accessChannels ` are per ** method** , not per
106+ feature: ` features/checkout ` serves ` checkout:session ` at ` /session ` over ` sync `
107+ and ` checkout:callback ` at ` /callback ` as a page, from one feature.
0 commit comments