Skip to content

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 ParameterDefault type
Decls extends RouteDeclarationRouteDeclaration

Properties ​

PropertyModifierTypeDescriptionDefined in
[routeDeclarations]?readonlyDeclsType-only: carries Decls; never set at runtime.index.ts:292
base?readonlystringThe 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 ​

ParameterType
pathnameOrUrl| string | { pathname: string; }

Returns ​

Promise<Verdict>