@marblejs/middleware-cors
A CORS middleware for Marble.js
Installation
Requires @marblejs/core
to be installed.
Importing
Type declaration
Parameters
parameter | definition |
options | <optional> |
CORSOptions
parameter | definition |
origin | <optional> |
methods | <optional> |
optionsSuccessStatus | <optional> |
allowHeaders | <optional> |
exposeHeaders | <optional> |
withCredentials | <optional> |
maxAge | <optional> |
This object allows you to configure CORS headers with various options. Both methods
and exposeHeaders
support wildcard. By default options are configured as following.
Note that provided options are merged with default options so you need to overwrite each default parameter you want to customize.
Basic usage
For security purpose it's better to be strict as possible when configuring CORS options.
Strict usage
Headers notation is case insensitive. content-type
will also work.
Last updated