@@ -5,23 +5,15 @@ skill: true
55---
66
77The package root exports one router. Mount ordinary application traffic at any
8- prefix and explicitly dispatch the private ` /api/rivet ` callback to the same
9- router:
8+ prefix and forward the private ` /api/rivet/* ` callback to the same router:
109
1110``` ts
1211import { appsRouter } from " @rivet-dev/dynamic-apps" ;
1312import { Hono } from " hono" ;
1413
1514const server = new Hono ();
1615
17- const dispatchRegistry = (request : Request ) => {
18- const headers = new Headers (request .headers );
19- headers .set (" x-agentos-app-registry-dispatch" , " 1" );
20- return appsRouter .fetch (new Request (request , { headers }));
21- };
22-
23- server .all (" /api/rivet" , (c ) => dispatchRegistry (c .req .raw ));
24- server .all (" /api/rivet/*" , (c ) => dispatchRegistry (c .req .raw ));
16+ server .all (" /api/rivet/*" , (c ) => appsRouter .fetch (c .req .raw ));
2517server .route (" /apps" , appsRouter );
2618```
2719
@@ -30,7 +22,3 @@ This serves `/:appId/*` relative to the mount. For example,
3022` /api/items?q=1 ` . A bare ` /apps/example ` request redirects to
3123` /apps/example/ ` .
3224
33- There is no ` createAppsRouter ` or router-specific client option in the default
34- adapter. ` appsRouter ` creates and reuses its private control client lazily. Once
35- an active artifact is prepared, warm requests use only the local runtime and
36- isolate caches: they do not call release storage or a Rivet actor.
0 commit comments