---
url: >-
  https://lit-ui-router.dev/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](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/route-trie.ts#L261)

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,
    },
  },
});
```
