---
url: >-
  https://lit-ui-router.dev/reference/ui-router-server/index/interfaces/ServerRouter.md
---
[ui-router-server](../../index.md) / [ui-router-server](../index.md) / ServerRouter

# Interface: ServerRouter\<Decls>

Defined in: [index.ts:275](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/index.ts#L275)

The compiled resolver [createServerRouter](../functions/createServerRouter.md) returns: a pathname in, a
[Verdict](../type-aliases/Verdict.md) 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](../../redirects/interfaces/RouteDeclaration.md), under which keys and names are `string`.

## Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
|  `Decls` *extends* [`RouteDeclaration`](../../redirects/interfaces/RouteDeclaration.md) | [`RouteDeclaration`](../../redirects/interfaces/RouteDeclaration.md) |

## Properties

| Property | Modifier | Type | Description | Defined in |
| ------ | ------ | ------ | ------ | ------ |
|  `[routeDeclarations]?` | `readonly` | `Decls` | Type-only: carries `Decls`; never set at runtime. | [index.ts:292](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/index.ts#L292) |
|  `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](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/index.ts#L290) |

## Methods

### resolve()

```ts
resolve(pathnameOrUrl): Promise<Verdict>;
```

Defined in: [index.ts:284](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/index.ts#L284)

Accepts a pathname, an absolute url string, or anything with a `pathname`
(URL, Location). Under a [base](#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`](../type-aliases/Verdict.md)>
