Skip to content

Commit

Permalink
fix: cors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kpoke committed May 16, 2023
1 parent 657f541 commit 54b394f
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 33 deletions.
4 changes: 1 addition & 3 deletions deployment/overlays/development/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
patchesStrategicMerge:
- mapping.yaml
resources:
bases:
- ../../base
11 changes: 0 additions & 11 deletions deployment/overlays/development/mapping.yaml

This file was deleted.

30 changes: 25 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@sentry/node": "^5.1.0",
"bcryptjs": "^2.4.3",
"chai-uuid": "^1.0.6",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"expect": "^26.4.2",
"expect-runtime": "^0.7.0",
Expand Down
5 changes: 5 additions & 0 deletions server/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
const express = require('express');
const Sentry = require('@sentry/node');
const cors = require('cors');
const HttpError = require('./utils/HttpError');
const routes = require('./routes');
const { errorHandler, handlerWrapper } = require('./utils/utils');

const app = express();

if (process.env.NODE_ENV === 'development') {
app.use(cors());
}

const config = require('../config/config.js');

Sentry.init({ dsn: config.sentry_dsn });
Expand Down
24 changes: 10 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,14 @@
"resolved" "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
"version" "1.0.2"

"cors@^2.8.5":
"integrity" "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g=="
"resolved" "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz"
"version" "2.8.5"
dependencies:
"object-assign" "^4"
"vary" "^1"

"cosmiconfig@^5.2.1":
"integrity" "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA=="
"resolved" "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz"
Expand All @@ -1426,13 +1434,6 @@
"path-type" "^4.0.0"
"yaml" "^1.10.0"

"cpu-features@0.0.2":
"integrity" "sha512-/2yieBqvMcRj8McNzkycjW2v3OIUOibBfd2dLEJ0nWts8NobAxwiyw9phVNS6oDL8x8tz9F7uNVFEVpJncQpeA=="
"resolved" "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.2.tgz"
"version" "0.0.2"
dependencies:
"nan" "^2.14.1"

"cross-spawn@^6.0.0":
"integrity" "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ=="
"resolved" "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz"
Expand Down Expand Up @@ -3864,11 +3865,6 @@
"resolved" "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz"
"version" "0.0.8"

"nan@^2.14.1", "nan@^2.15.0":
"integrity" "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ=="
"resolved" "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz"
"version" "2.15.0"

"nanoid@3.3.3":
"integrity" "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w=="
"resolved" "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz"
Expand Down Expand Up @@ -4022,7 +4018,7 @@
"test-exclude" "^6.0.0"
"yargs" "^15.0.2"

"object-assign@^4.1.1":
"object-assign@^4", "object-assign@^4.1.1":
"integrity" "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
"resolved" "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
"version" "4.1.1"
Expand Down Expand Up @@ -5671,7 +5667,7 @@
"resolved" "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz"
"version" "13.7.0"

"vary@~1.1.2":
"vary@^1", "vary@~1.1.2":
"integrity" "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
"resolved" "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
"version" "1.1.2"
Expand Down

0 comments on commit 54b394f

Please sign in to comment.