---
url: >-
  https://lit-ui-router.dev/api/ui-router-server/fetch/type-aliases/DelegateHandler.md
---
[ui-router-server](../../index.md) / [fetch](../index.md) / DelegateHandler

# Type Alias: DelegateHandler\<Args>

```ts
type DelegateHandler<Args> = (request, ...args) => 
  | Response
| Promise<Response>;
```

Defined in: [fetch.ts:141](https://github.com/simshanith/lit-ui-router/blob/3ab90929a8d23dda96e259d7396a274c5b05398e/packages/ui-router-server/src/fetch.ts#L141)

Answers a request whose pathname matched a delegating state: fetch-shaped,
so a Hono app's `fetch` or a Worker's handler fits bare. It receives the
original request, body unread, plus the arguments the adapter was called
with; its Response goes out untouched. Read the matched route with
[delegateContext](../functions/delegateContext.md).

## Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
|  `Args` *extends* `unknown`\[] | \[] |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `request` | [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) |
| ...`args` | `Args` |

## Returns

| [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
| `Promise`<[`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)>
