> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tappify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# toNode

> Wraps the handler as a listener for Node's own http.createServer, with no framework in between.

```ts theme={null}
function toNode(handler): NodeRequestListener;
```

Wraps the handler as a listener for Node's own `http.createServer`, with no
framework in between.

## Parameters

### handler

[`TappifyFetchHandler`](/extensions/reference/server-api/TypeAlias.TappifyFetchHandler)

## Returns

[`NodeRequestListener`](/extensions/reference/server-api/TypeAlias.NodeRequestListener)

## Remarks

It builds the url from `request.url` and the `host` header over `http`, forwards
every header, and reads the body straight off the stream, so nothing may have
consumed it first. It answers the whole response itself: a `TapServerError`
becomes its own code and status, and anything else becomes 500
`TAP_INTERNAL_ERROR`. Put it behind a TLS-terminating proxy in production; the
scheme it builds is only what the handler sees in `request.url`.

## Example

```ts theme={null}
import { createTappifyHandler, toNode } from '@tappify/extension-sdk/server';
import { createServer } from 'node:http';

const listener = toNode(
  createTappifyHandler({ extensionId: 'starter', health: () => ({ ok: true }) }),
);
const server = createServer(listener);
```
