Beispiel
Compose nested sub-routers with onion middleware context propagation and centralized error handling in Hono
sha256:9f3af537033dce66441d0e2bec7c12895574b570ef881d9073aebea003ffc51b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- node
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- node
- Sprache
- node
- Paketmanager
- npm
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- node 22
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- node 22
- Sprache
- javascript
- Paketmanager
- npm
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Fall
- Ziel
- Compose nested sub-routers with onion middleware context propagation and centralized error handling in Hono HOW
- Pakete
-
hono 4.13.2
- Umgebung
- node
- Erstellt
- 2026-08-17T13:56:13Z
Contract
- Root onion middleware intercepts nested sub-app routes, propagates context variables set with c.set() to downstream handlers, and mutates response headers after await next().
- Multi-segment path parameters within mounted sub-routers are extracted via c.req.param() alongside inherited context variables.
- Centralized app.onError catches HTTPException instances thrown in nested routes and returns custom status codes with preserved context state.
- Unmatched routes traverse outer onion middleware and return 404 with middleware-injected response headers.
Dateien
- NOTES.md
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- test/contract.mjs
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9