diff options
-rw-r--r-- | server/main.js | 3 | ||||
-rw-r--r-- | server/package-lock.json | 9 | ||||
-rw-r--r-- | server/package.json | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/server/main.js b/server/main.js index e6f5558..ab7ce4d 100644 --- a/server/main.js +++ b/server/main.js @@ -2,6 +2,7 @@ const express = require('express'); const app = express(); const mongoose = require('mongoose'); const passport = require('passport'); +const cors = require('cors'); const {port, mongoUrl} = require("./config/env"); const apiRoutes = require('./routes/api'); @@ -20,6 +21,8 @@ app.use(express.json()); require('./config/passport'); app.use(passport.initialize()); +app.use(cors()); + app.use('/api', apiRoutes); app.use('/api/uploads', express.static('uploads')); diff --git a/server/package-lock.json b/server/package-lock.json index 20078c9..e71a274 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -424,6 +424,15 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "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" + } + }, "crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", diff --git a/server/package.json b/server/package.json index a1c3c05..9209187 100644 --- a/server/package.json +++ b/server/package.json @@ -11,6 +11,7 @@ "license": "GPL-3.0", "dependencies": { "bcryptjs": "^2.4.3", + "cors": "^2.8.5", "dotenv": "^10.0.0", "express": "^4.17.1", "jsonwebtoken": "^8.5.1", |