Module: caf_platform/gen_pipe

Generic message processing pipeline component.

Properties:

  {webSocketPipe: boolean, httpPipe: boolean, path: string}

where:

  • webSocketPipe: Whether this pipe should apply to websockets.
  • httpPipe: Whether this pipe should apply to http requests.
  • path: Route that activates this pipe.
Source:

Extends

Members

__ca_isPipe__ :boolean

Run-time type information.

Type:
  • boolean
Source:

Methods

__ca_connectSetup__(app)

Creates a connect middleware function with interface function(req, res, next), and registers it with the application.

Parameters:
Name Type Description
app Object

A connect application to register a middleware function.

Source:

__ca_isHttpPipe__() → {boolean}

Whether this pipe should be added to the http pipeline.

Source:
Returns:

True if this pipe should be added to the http pipeline.

Type
boolean

__ca_isWebSocketPipe__() → {boolean}

Whether this pipe should be added to the websocket pipeline.

Source:
Returns:

True if this pipe should be added to the websocket pipeline.

Type
boolean

__ca_send__(res, data)

Sends a reply on a websocket or an http post.

Parameters:
Name Type Description
res Object

A response stream object.

data string | Object

A JSON serialized object or an object to serialize.

Source: