Module: lib/common/httpres

Module with common http response functions

Source:
Tutorials:

Methods

(inner) createBody(req, operationId) → {Object}

Creates and returns response body object

Parameters:
Name Type Description
req Object

the http request

operationId string

the operation id as defined in the openapi definition

Source:
Returns:

the response body

Type
Object

(inner) getURL(req) → {string}

Returns the URL without path of the request

Parameters:
Name Type Description
req Object

the http request

Source:
Returns:

the url without path

Type
string

(inner) sendImperative(res, err, resBody, resData, callback)

Sends imperative response based on available data and errors

Parameters:
Name Type Description
res Object

the http response object

err Error

error object if any errors

resBody Object

the response body

resData Object

the response data

callback logEndpointEventCb
Source:

(inner) sendIndicative(res, err, resBody, resData, callback)

Sends informative response based on available data and errors

Parameters:
Name Type Description
res Object

the http response object

err Error

error object if any errors

resBody Object

the response body

resData Object

the response data

callback logEndpointEventCb
Source: