nx.js
Functions

createServerHandler

createServerHandler(handler): (event) => Promise<void>

Creates a socket handler function which accepts a socket event and parses the incoming data as an HTTP request.

Note

This is a low-level function which usually should not be used directly. See listen() instead, which is a higher-level wrapper around this function.

Parameters

ParameterTypeDescription
handlerServerHandlerThe HTTP handler function to invoke when an HTTP request is received

Returns

Function

Parameters

ParameterType
eventSocketEvent

Returns

Promise<void>

On this page