@bdt/header-settings
v1.0.7
Published
Express middleware for allowing and exposing response headers.
Downloads
3
Readme
Express Middleware - header settings
Express middleware for setting header, for centralizing settings between services.
Sets the following:
- res.header("Access-Control-Allow-Origin", options.origin);
- res.header("Access-Control-Allow-Methods", options.methods);
- res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Authorization, appname, Accept, responseType, referer, Accept-Encoding, Content-Encoding" + options.headers);
- res.header("Access-Control-Expose-Headers", options.headers);
defaults:
- origin: "*"
- methods: "PUT,GET,POST,DELETE,OPTIONS"
- allow-headers: "Origin, X-Requested-With, Content-Type, Authorization, appname, Accept, responseType, referer, Accept-Encoding, Content-Encoding"
options:
- origin: Array of strings of origins
- methods: Array of strings of methods
- headers: Array of strings of custom headers