From 4a46751505dc8577bed210adc597c6696708e21f Mon Sep 17 00:00:00 2001 From: Gianmarco Pettinato Date: Fri, 24 Sep 2021 16:19:56 +0200 Subject: [PATCH] first stable release --- package-lock.json | 28 +++++++++++++++++++++++----- package.json | 1 + src/app.ts | 2 ++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 82dd47b..9ac5d22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "axios": "^0.21.4", "body-parser": "^1.19.0", + "cors": "^2.8.5", "dayjs": "^1.10.7", "dcc-utils": "^0.2.0", "express": "^4.17.1", @@ -4622,6 +4623,18 @@ "optional": true, "peer": true }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cose-js": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/cose-js/-/cose-js-0.6.0.tgz", @@ -8585,8 +8598,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -15529,6 +15540,15 @@ "optional": true, "peer": true }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "cose-js": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/cose-js/-/cose-js-0.6.0.tgz", @@ -18737,9 +18757,7 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "optional": true, - "peer": true + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-copy": { "version": "0.1.0", diff --git a/package.json b/package.json index 60e4f91..0ed33c0 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "axios": "^0.21.4", "body-parser": "^1.19.0", + "cors": "^2.8.5", "dayjs": "^1.10.7", "dcc-utils": "^0.2.0", "express": "^4.17.1", diff --git a/src/app.ts b/src/app.ts index bf1c091..a806054 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,9 +1,11 @@ import { setupApis } from './api'; import express from 'express'; +import cors from 'cors'; const app = express(); app.set('port', process.env.PORT || 3000); +app.use(cors()); app.use(express.json()); app.use(express.urlencoded()); setupApis(app);