@jaypie/express 1.1.5 → 1.1.6
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.
- package/dist/module.cjs +0 -5
- package/dist/module.esm.js +0 -5
- package/package.json +2 -2
- package/src/cors.helper.js +0 -5
package/dist/module.cjs
CHANGED
|
@@ -100,20 +100,15 @@ const corsHelper = (config = {}) => {
|
|
|
100
100
|
// Export
|
|
101
101
|
//
|
|
102
102
|
|
|
103
|
-
console.log("Export cors middleware");
|
|
104
103
|
var cors_helper = (config) => {
|
|
105
|
-
console.log("Create cors middleware");
|
|
106
104
|
const cors = corsHelper(config);
|
|
107
105
|
return (req, res, next) => {
|
|
108
|
-
console.log("Run cors middleware");
|
|
109
106
|
cors(req, res, (error) => {
|
|
110
107
|
if (error) {
|
|
111
108
|
res.status(error.status);
|
|
112
109
|
res.setHeader("Content-Type", "application/json");
|
|
113
|
-
console.log("Return cors error");
|
|
114
110
|
return res.json(error.body());
|
|
115
111
|
}
|
|
116
|
-
console.log("Allow next");
|
|
117
112
|
next();
|
|
118
113
|
});
|
|
119
114
|
};
|
package/dist/module.esm.js
CHANGED
|
@@ -98,20 +98,15 @@ const corsHelper = (config = {}) => {
|
|
|
98
98
|
// Export
|
|
99
99
|
//
|
|
100
100
|
|
|
101
|
-
console.log("Export cors middleware");
|
|
102
101
|
var cors_helper = (config) => {
|
|
103
|
-
console.log("Create cors middleware");
|
|
104
102
|
const cors = corsHelper(config);
|
|
105
103
|
return (req, res, next) => {
|
|
106
|
-
console.log("Run cors middleware");
|
|
107
104
|
cors(req, res, (error) => {
|
|
108
105
|
if (error) {
|
|
109
106
|
res.status(error.status);
|
|
110
107
|
res.setHeader("Content-Type", "application/json");
|
|
111
|
-
console.log("Return cors error");
|
|
112
108
|
return res.json(error.body());
|
|
113
109
|
}
|
|
114
|
-
console.log("Allow next");
|
|
115
110
|
next();
|
|
116
111
|
});
|
|
117
112
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaypie/express",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Finlayson Studio",
|
|
6
6
|
"type": "module",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "965664acbece6bd2ca688289928f93cd81a9d2b1"
|
|
47
47
|
}
|
package/src/cors.helper.js
CHANGED
|
@@ -83,20 +83,15 @@ const corsHelper = (config = {}) => {
|
|
|
83
83
|
// Export
|
|
84
84
|
//
|
|
85
85
|
|
|
86
|
-
console.log("Export cors middleware");
|
|
87
86
|
export default (config) => {
|
|
88
|
-
console.log("Create cors middleware");
|
|
89
87
|
const cors = corsHelper(config);
|
|
90
88
|
return (req, res, next) => {
|
|
91
|
-
console.log("Run cors middleware");
|
|
92
89
|
cors(req, res, (error) => {
|
|
93
90
|
if (error) {
|
|
94
91
|
res.status(error.status);
|
|
95
92
|
res.setHeader("Content-Type", "application/json");
|
|
96
|
-
console.log("Return cors error");
|
|
97
93
|
return res.json(error.body());
|
|
98
94
|
}
|
|
99
|
-
console.log("Allow next");
|
|
100
95
|
next();
|
|
101
96
|
});
|
|
102
97
|
};
|