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

# Interface: ConnectResponse

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

The subset of `http.ServerResponse` the middleware writes. `writeHead` is
variadic to admit Node's `(status, statusMessage?, headers?)` overloads —
the relabeling patch must forward whichever shape the downstream used.

## Methods

### end()

```ts
end(body?): void;
```

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

Ends the response, optionally with a body.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `body?` | `string` |

#### Returns

`void`

***

### setHeader()

```ts
setHeader(name, value): void;
```

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

Sets one response header (the canonical `Link` on a shell verdict).

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `name` | `string` |
| `value` | `string` |

#### Returns

`void`

***

### writeHead()

```ts
writeHead(statusCode, ...rest): void;
```

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

Writes the status line and headers; patched to relabel a status'd shell.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `statusCode` | `number` |
| ...`rest` | `unknown`\[] |

#### Returns

`void`
