kronos-interceptor-http-request

3.2.10 • Public • Published

npm Greenkeeper semantic-release Build Status bithound codecov.io Coverage Status Code Climate Known Vulnerabilities GitHub Issues Stories in Ready Dependency Status devDependency Status docs downloads Commitizen friendly

kronos-interceptor-http-request

Interceptor to convert messages into multipart form data and back

API Reference

transformMessageToRequestMessage(message) ⇒

Copies the fields 'info' and 'hops' into the new message. Then create a formdata object containing 'info', 'hops' and 'payload'. Stores the formdata object as the payload of the 'newMessage' object.

Kind: global function
Returns: newMessage The transformed message

Param Description
message The message to transform

unpackToMessage(request, forwardFunction) ⇒

Unpacks a message from a multipart http request

Kind: global function
Returns: Promise A promise with the result of the forwardFunction

Param Description
request The incomming http request
forwardFunction The function to call with the new generated message. The function must return a Promise. If no 'forwardFunction' is given It will return the message in the promise

install

With npm do:

npm install kronos-interceptor-http-request

license

BSD-2-Clause

Package Sidebar

Install

npm i kronos-interceptor-http-request

Weekly Downloads

2

Version

3.2.10

License

BSD-2-Clause

Last publish

Collaborators

  • darlenya