---
url: >-
  https://lit-ui-router.dev/v1/reference/ui-router-server/index/variables/routeTrie.md
---
[ui-router-server](../../index.md) / [ui-router-server](../index.md) / routeTrie

# Variable: routeTrie

```ts
const routeTrie: RouteIndex;
```

Defined in: route-trie.ts:261

The trie [RouteIndex](../../redirects/type-aliases/RouteIndex.md): hand it to
[\`MountConfig.routeIndex\`](../interfaces/MountConfig.md#routeindex) to resolve a
'matcher' mount by segment trie instead of a linear scan. Verdicts are the
linear scan's. It throws at construction, naming each route it can't
express: a case-insensitive url config, or a path param whose pattern may
match a `/`.

## Example

```ts
import { createServerRouter, routeTrie } from 'ui-router-server';

const router = createServerRouter({
  mounts: {
    '/app': {
      routes: [{ name: 'home', url: '' }, { name: 'item', url: '/items/:id' }],
      routeIndex: routeTrie,
    },
  },
});
```
