Skip to content

Commit

Permalink
Adding cors
Browse files Browse the repository at this point in the history
  • Loading branch information
israelvf committed Mar 6, 2020
1 parent 05215a5 commit 0aa8a37
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions backend/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 backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"express": "^4.17.1",
"mongoose": "^5.9.3",
"mongoose-paginate": "^5.0.3",
Expand Down
2 changes: 2 additions & 0 deletions backend/server.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const express = require("express");
const cors = require("cors");
const mongoose = require("mongoose");
const requireDir = require("require-dir");

// Starting app
const app = express();
app.use(express.json());
app.use(cors());

// Connecting with DB
mongoose.connect("mongodb://localhost:27017/nodeapi", {
Expand Down

0 comments on commit 0aa8a37

Please sign in to comment.