---
url: https://lit-ui-router.dev/api/lit-ui-router-ssr/index/variables/settle.md
---
[lit-ui-router-ssr](../../index.md) / [lit-ui-router-ssr](../index.md) / settle

# Variable: settle

```ts
const settle: (router, path, options?) => Promise<Transition>;
```

Defined in: packages/ui-router-server/dist/ssr.d.ts:55

Moves `router` to `path` and resolves once the transition the url starts
has landed, resolves included, so a synchronous render reads the router
after it.

It never starts the router, which happens once per router (`start()` on a
`UIRouterLit`, `urlService.listen()` on a core router): it sets the
url and syncs the router to it, whether or not the router is listening.
A page loop calls it once per path on the same router. A `redirectTo`
chain settles on its final state, and a path the router already stands on
resolves with the transition that brought it there.

A failed transition still reaches `stateService.defaultErrorHandler`,
which logs it unless replaced.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `router` | [`UIRouter`](https://ui-router.github.io/core/docs/latest/classes/_router_.uirouter.html) | the server router, its location installed with `installServerLocation` |
| `path` | `string` | the url to settle on, relative to the mount, query included |
| `options?` | [`SettleOptions`](../interfaces/SettleOptions.md) | how long to wait, and how many url rewrites to follow |

## Returns

`Promise`<`Transition`>

the transition that landed

## Throws

an `Error` when no url rule matches `path` and the router declares no `otherwise`

## Throws

an `Error` whose `cause` is the transition's `Rejection` when it fails, a failed resolve's error in that rejection's `detail`

## Throws

an `Error` when nothing lands within [\`timeout\`](../interfaces/SettleOptions.md#timeout)

## Throws

an `Error` when url rules rewrite the url more than [\`maxRewrites\`](../interfaces/SettleOptions.md#maxrewrites) times

## Example

```ts
import { installServerLocation } from 'ui-router-server/location';
import { settle } from 'ui-router-server/ssr';

installServerLocation(router, { urlConfig: { strict: false } });

for (const path of ['/', '/sheet/7B']) {
  await settle(router, path);
  pages.set(path, render(router));
}
```
