ui-router-server / fetch / FetchAdapterOptions
Interface: FetchAdapterOptions
Defined in: fetch.ts:43
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
serveNotFound? | (mount, request) => | Response | Promise<Response> | Serve a mount-owned miss (notFound with a mount: the mount owned the pathname but no route matched). The default answers a minimal text/plain 404 — override to serve a real 404 page. A notFound without a mount is never routed here: the pathname isn't this router's, so the handler returns null and the host serves it. | fetch.ts:67 |
serveShell | (mount, request) => | Response | Promise<Response> | Serve the mount's shell asset. The adapter hands over a shell Request already rewritten to shellPath and, for a status'd shell, already stripped of conditional validators — so the host returns the RAW asset Response ((mount, request) => env.ASSETS.fetch(request)) and the adapter owns the status relabel and Link header on the way out. REQUIRED: asset IO is the one thing a runtime-neutral adapter cannot default. | fetch.ts:59 |
shellPath? | (mount) => string | Maps a shell verdict's mount to the pathname the shell Request is built at (default: the mount base itself). The hook for aliased mounts whose shell asset lives under another prefix (e.g. a 404 exhibit that borrows the vanilla app's shell). | fetch.ts:50 |
shouldHandle? | (request) => boolean | Which requests get verdicts. The default is the navigation heuristic the Connect adapter uses (and Vite's HTML fallback mirrors): GET/HEAD requests whose Accept includes text/html. Module and asset fetches (Accept: */*) pass as null. Override with () => true when the handler runs behind the static layer and should judge everything. | fetch.ts:78 |