@jaypie/express 1.1.6 → 1.1.7
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 +5 -2
- package/dist/module.esm.js +5 -2
- package/package.json +2 -2
- package/src/cors.helper.js +5 -1
package/dist/module.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var errors = require('@jaypie/errors');
|
|
4
|
-
var expressCors = require('cors');
|
|
5
4
|
var core = require('@jaypie/core');
|
|
5
|
+
var expressCors = require('cors');
|
|
6
6
|
var serverlessExpress = require('@codegenie/serverless-express');
|
|
7
7
|
|
|
8
8
|
//
|
|
@@ -69,7 +69,10 @@ const corsHelper = (config = {}) => {
|
|
|
69
69
|
];
|
|
70
70
|
|
|
71
71
|
// Add localhost origins in sandbox
|
|
72
|
-
if (
|
|
72
|
+
if (
|
|
73
|
+
process.env.PROJECT_ENV === SANDBOX_ENV ||
|
|
74
|
+
core.envBoolean("PROJECT_DEV")
|
|
75
|
+
) {
|
|
73
76
|
allowedOrigins.push("http://localhost");
|
|
74
77
|
allowedOrigins.push(/^http:\/\/localhost:\d+$/);
|
|
75
78
|
}
|
package/dist/module.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CorsError } from '@jaypie/errors';
|
|
2
|
+
import { envBoolean, log, JAYPIE, HTTP, validate, force, jaypieHandler, UnhandledError, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, MethodNotAllowedError, GoneError, TeapotError, InternalError, BadGatewayError, UnavailableError, GatewayTimeoutError, NotImplementedError } from '@jaypie/core';
|
|
2
3
|
import expressCors from 'cors';
|
|
3
|
-
import { log, JAYPIE, HTTP, validate, force, jaypieHandler, UnhandledError, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, MethodNotAllowedError, GoneError, TeapotError, InternalError, BadGatewayError, UnavailableError, GatewayTimeoutError, NotImplementedError } from '@jaypie/core';
|
|
4
4
|
import { getCurrentInvoke } from '@codegenie/serverless-express';
|
|
5
5
|
|
|
6
6
|
//
|
|
@@ -67,7 +67,10 @@ const corsHelper = (config = {}) => {
|
|
|
67
67
|
];
|
|
68
68
|
|
|
69
69
|
// Add localhost origins in sandbox
|
|
70
|
-
if (
|
|
70
|
+
if (
|
|
71
|
+
process.env.PROJECT_ENV === SANDBOX_ENV ||
|
|
72
|
+
envBoolean("PROJECT_DEV")
|
|
73
|
+
) {
|
|
71
74
|
allowedOrigins.push("http://localhost");
|
|
72
75
|
allowedOrigins.push(/^http:\/\/localhost:\d+$/);
|
|
73
76
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaypie/express",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
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": "b6172271a5bfdc96126fe3eded3e17e382c4409b"
|
|
47
47
|
}
|
package/src/cors.helper.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CorsError } from "@jaypie/errors";
|
|
2
|
+
import { envBoolean } from "@jaypie/core";
|
|
2
3
|
import expressCors from "cors";
|
|
3
4
|
|
|
4
5
|
//
|
|
@@ -52,7 +53,10 @@ const corsHelper = (config = {}) => {
|
|
|
52
53
|
];
|
|
53
54
|
|
|
54
55
|
// Add localhost origins in sandbox
|
|
55
|
-
if (
|
|
56
|
+
if (
|
|
57
|
+
process.env.PROJECT_ENV === SANDBOX_ENV ||
|
|
58
|
+
envBoolean("PROJECT_DEV")
|
|
59
|
+
) {
|
|
56
60
|
allowedOrigins.push("http://localhost");
|
|
57
61
|
allowedOrigins.push(/^http:\/\/localhost:\d+$/);
|
|
58
62
|
}
|