We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8df3c91 commit 8ce5ed8Copy full SHA for 8ce5ed8
package.json
@@ -18,6 +18,7 @@
18
"license": "ISC",
19
"dependencies": {
20
"body-parser": "^1.19.0",
21
+ "cors": "^2.8.5",
22
"express": "^4.17.1",
23
"mysql2": "^2.0.2",
24
"sequelize": "^5.21.2"
server.js
@@ -1,8 +1,15 @@
1
const express = require("express");
2
const bodyParser = require("body-parser");
3
+const cors = require("cors");
4
5
const app = express();
6
7
+var corsOptions = {
8
+ origin: "http://localhost:8081"
9
+};
10
+
11
+app.use(cors(corsOptions));
12
13
// parse requests of content-type - application/json
14
app.use(bodyParser.json());
15
0 commit comments