ui-router-server / fetch / createFetchHandler
Function: createFetchHandler()
ts
function createFetchHandler(router, options): FetchHandler;Defined in: fetch.ts:145
Wraps a ServerRouter as a WinterCG fetch handler. resolve() is always async (the simulate tier's lazy boundary), which fetch absorbs naturally — with matcher-tier mounts nothing async ever actually runs.
redirect->Response(null, { status, Location }), the request's search MERGED into the location via mergeSearch (targets that declare their own query keep it — never?a=1?b=2).shell-> serveShell on a Request rewritten to shellPath, the raw asset Response wrapped with aLink: <mount>; rel="canonical"header (the shell is the same representation at every route path).shellwith status (the otherwise projection) -> validators stripped, the asset Response's status relabeled to the verdict's, no canonical Link (a 404 is not an alternate representation of the mount root).notFoundwith a mount -> serveNotFound (honest 404).notFoundwithout a mount, or a non-navigation request ->null(the host serves it however it would have).
Parameters
| Parameter | Type |
|---|---|
router | ServerRouter |
options | FetchAdapterOptions |