0.0.0 • Published 5 years ago

whook-cors v0.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

whook-cors

A wrapper to provide CORS support to a Whook server

GitHub license NPM version Dependency Status devDependency Status Package Quality

API

wrapHTTPRouterWithSwaggerUI(initHTTPRouter) ⇒ function

Wraps the httpRouter initializer to also serve the Swagger/OpenAPI UI for development purpose.

Kind: global function
Returns: function - The httpRouter initializer wrapped

ParamTypeDescription
initHTTPRouterfunctionThe httpRouter initializer

Authors

License

MIT

API

Constants

Functions

optionsWithCORS ⇒ Promise.<Object>

A simple Whook handler that just returns a 200 OK HTTP response

Kind: global constant
Returns: Promise.<Object> - The HTTP response object

wrapHandlerWithCORS(initHandler) ⇒ function

Wrap an handler initializer to append CORS to response.

Kind: global function
Returns: function - The handler initializer wrapped

ParamTypeDescription
initHandlerfunctionThe handler initializer

augmentAPIWithCORS(API) ⇒ Promise.<Object>

Augment an OpenAPI to also serve OPTIONS methods with the CORS added.

Kind: global function
Returns: Promise.<Object> - The augmented OpenAPI object

ParamTypeDescription
APIObjectThe OpenAPI object

Authors

License

MIT