whook-cors
v0.0.0
Published
A wrapper to provide CORS support to a Whook server
Downloads
1
Readme
whook-cors
A wrapper to provide CORS support to a Whook server
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
| Param | Type | Description |
| --- | --- | --- |
| initHTTPRouter | function | The httpRouter
initializer |
Authors
License
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
| Param | Type | Description | | --- | --- | --- | | initHandler | function | The 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
| Param | Type | Description | | --- | --- | --- | | API | Object | The OpenAPI object |