Commit dfe19027 authored by Martin Wighus Holtmon's avatar Martin Wighus Holtmon
Browse files

projectSecondPart/Problem2 - fixed cors problem by adding cors as express middleware.

parent 123ef2c0
......@@ -4522,6 +4522,15 @@
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
"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"
}
},
"cosmiconfig": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz",
......
......@@ -7,6 +7,7 @@
},
"dependencies": {
"@material-ui/core": "^4.12.3",
"cors": "^2.8.5",
"express": "^4.17.1",
"nodemon": "^2.0.15",
"react": "^17.0.2",
......
......@@ -10,10 +10,12 @@
/* jshint node: true */
const express = require('express');
const cors = require('cors');
const portno = 3001; // Port number to use
const app = express();
app.use(cors());
const PROG2053models = require('./src/model-data/PhotoApp.js');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment