Skip to content

Commit

Permalink
cors added
Browse files Browse the repository at this point in the history
  • Loading branch information
amrebada committed Jan 3, 2020
1 parent 5d3ba66 commit 54de3fd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
12 changes: 10 additions & 2 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 @@ -36,6 +36,7 @@
"dependencies": {
"bcryptjs": "2.4.3",
"body-parser": "1.19.0",
"cors": "2.8.5",
"dotenv": "8.2.0",
"express": "4.17.1",
"express-graphql": "0.9.0",
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import express from "express";
import graphQlHTTP from "express-graphql";
import bodyParser from "body-parser";
import cors from "cors";
import schema from "./schemas";
import dbInit from "./models/index";
import config from "./config";
import auth from "./routes/auth";

const app = express();

app.use(
cors({
origin: "*"
})
);
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

Expand Down

0 comments on commit 54de3fd

Please sign in to comment.