@bee.js/node 0.0.83 → 0.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- module.exports = function ({ req, res, next, app, configs = {} }) {
1
+ module.exports = function ({ next, app, configs = {} }) {
2
2
  app.use((req, res, next) => {
3
- res.header("Access-Control-Allow-Origin", "*");
3
+ if (!configs.headers) res.header("Access-Control-Allow-Origin", "*");
4
4
 
5
5
  for (const key in configs.headers || {}) {
6
6
  res.header(key, configs.headers[key]);
@@ -9,9 +9,9 @@ module.exports = function ({ req, res, next, app, configs = {} }) {
9
9
  next();
10
10
  });
11
11
 
12
- // Middleware específico para requisições OPTIONS (preflight)
12
+ // OPTIONS (preflight)
13
13
  app.options("*", (req, res) => {
14
- res.header("Access-Control-Allow-Origin", "*");
14
+ if (!configs.headers) res.header("Access-Control-Allow-Origin", "*");
15
15
 
16
16
  for (const key in configs.headers || {}) {
17
17
  res.header(key, configs.headers[key]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bee.js/node",
3
- "version": "0.0.83",
3
+ "version": "0.0.84",
4
4
  "description": "A JavaScript framework for making Node.js API´s",
5
5
  "main": "index.js",
6
6
  "scripts": {