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.

Parameters

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

Returns

Function

Parameters

ParameterType
eventSocketEvent

Returns

Promise<void>

Note

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

On this page