Skip to main content
Wraps the handler as a listener for Node’s own http.createServer, with no framework in between.

Parameters

handler

TappifyFetchHandler

Returns

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