MiddlewareModule

middleware. MiddlewareModule

Adds useful Express middleware to the server stack

Constructor

new MiddlewareModule()

Source:

Extends

  • AbstractModule

Methods

bodyParserJson() → {function}

Source:
See:
Parses incoming JSON data to req.body
Returns:
Express middleware function
Type
function

bodyParserUrlEncoded() → {function}

Source:
See:
Parses incoming URL-encoded data to req.body
Returns:
Express middleware function
Type
function

fileUploadParser(expectedFileTypes, options) → {function}

Source:
Handles incoming file uploads
Parameters:
Name Type Description
expectedFileTypes Array.<String> List of file types to accept
options FileUploadOptions
Returns:
The Express handler
Type
function

(async) init()

Source:

setDefaultFileOptions(options) → {FileUploadOptions}

Source:
Sets default file upload options
Parameters:
Name Type Description
options object The initial options object
Returns:
Type
FileUploadOptions

urlUploadParser(expectedFileTypes, options) → {function}

Source:
Handles incoming file uploads via URL
Parameters:
Name Type Description
expectedFileTypes Array.<String> List of file types to accept
options FileUploadOptions
Returns:
The Express handler
Type
function