ui-router-server / ui-router-server / ServerRouter
Interface: ServerRouter<Decls>
Defined in: index.ts:275
The compiled resolver createServerRouter returns: a pathname in, a Verdict out. Decls is the union of the route declarations it was built from, inferred from as const routes; the fetch adapter reads its delegate keys and state names. Untyped routes keep the default, RouteDeclaration, under which keys and names are string.
Type Parameters
| Type Parameter | Default type |
|---|---|
Decls extends RouteDeclaration | RouteDeclaration |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
[routeDeclarations]? | readonly | Decls | Type-only: carries Decls; never set at runtime. | index.ts:292 |
base? | readonly | string | The url path the site is served at, from createServerRouter({ base }), with one trailing slash. The adapters, serverRouterPlugin and prerender default their own base to it. | index.ts:290 |
Methods
resolve()
ts
resolve(pathnameOrUrl): Promise<Verdict>;Defined in: index.ts:284
Accepts a pathname, an absolute url string, or anything with a pathname (URL, Location). Under a base, the pathname lies under it, with the base taken off, as the adapters hand it over; verdict mounts and redirect locations come back the same way.
Parameters
| Parameter | Type |
|---|---|
pathnameOrUrl | | string | { pathname: string; } |
Returns
Promise<Verdict>