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

# Interface: ConnectAdapterOptions

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

Host hooks for [createConnectMiddleware](../functions/createConnectMiddleware.md): asset IO, and which requests get verdicts.

## Extended by

* [`ServerRouterPluginOptions`](../../vite/interfaces/ServerRouterPluginOptions.md)

## Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
|  `base?` | `string` | The url path the site is served at, such as Vite's `base`; `/` by default. The middleware matches `req.url` with the base taken off, so the mount table stays at `/`, passes a request outside the base to `next()` untouched, and puts the base back on redirect `Location`s, the canonical `Link` and the url the default [serveShell](#serveshell) hands downstream. A host `serveShell` sees `req.url` with the base on. Defaults to the router's [base](../../index/interfaces/ServerRouter.md#base); a different value throws. Under a base the router doesn't declare, the middleware resolves the base once and fails every request through `next(error)` when a mount already carries it. | [connect.ts:86](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/connect.ts#L86) |
|  `delegates?` | `"next"` | How delegating states are served. Connect has no fetch-shaped handler bridge, so `'next'` is the only mode: a navigation that matches a delegating state passes to the downstream stack, which must serve it. Without it, construction throws for a router from `createServerRouter` that names delegate keys, and a structural router's delegate verdict fails the request through `next(error)`. | [connect.ts:140](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/connect.ts#L140) |
|  `responses?` | `"next"` | How response states are served, as for [delegates](#delegates): `'next'` passes a navigation that matches one to the downstream stack, which must answer it. Without it, construction throws for a router from `createServerRouter` that declares response states, and a structural router's response verdict fails the request through `next(error)`. | [connect.ts:148](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/connect.ts#L148) |
|  `serveNotFound?` | (`mount`, `req`, `res`, `next`) => `void` | Serve a mount-owned miss (`notFound` with a mount: the mount owned the pathname but no route matched). The default answers a minimal `text/plain` 404 — override to serve a real 404 page. A `notFound` without a mount is never routed here: the pathname isn't this router's, so the middleware always passes it through untouched. | [connect.ts:116](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/connect.ts#L116) |
|  `serveShell?` | (`mount`, `req`, `res`, `next`, `verdict`) => `void` | Serve the mount's shell. The default rewrites `req.url` to [shellPath](#shellpath) and `next()`s into the downstream static layer. By the time this runs the adapter has already done the status'd-shell mechanics: request validators stripped and the response relabeled to the verdict's status — a host override only owns the asset IO. The verdict arrives last, so a host can serve a 404 page for the `otherwise` projection's `status`. | [connect.ts:102](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/connect.ts#L102) |
|  `shellPath?` | (`mount`) => `string` | Maps a shell verdict's mount to the path the default [serveShell](#serveshell) rewrites `req.url` to (default: the mount base itself). The hook for aliased mounts whose shell lives under another prefix. | [connect.ts:92](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/connect.ts#L92) |
|  `shouldHandle?` | (`req`) => `boolean` | Which requests get verdicts. The default is the navigation heuristic `connect-history-api-fallback` established (and Vite's own HTML fallback mirrors): GET/HEAD requests whose Accept includes `text/html`. Module and asset fetches (`Accept: *​/*`) pass through untouched — essential under Vite, where a mount's module URLs live on the same paths as its routes. Override with `() => true` when the middleware sits behind the static layer and should judge everything. | [connect.ts:131](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/connect.ts#L131) |
