Update: Move Cors inside Routes definition

This commit is contained in:
Yûki VACHOT 2021-12-23 13:18:04 +01:00
parent a12926f277
commit f26fcdc961
3 changed files with 39 additions and 23 deletions

View file

@ -9,17 +9,6 @@ const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({extended:true}));
app.use(bodyParser.json());
const cors = require('cors');
app.use(cors({
origin: [
'http://127.0.0.1:4200',
'http://127.0.0.1:4201',
'https://admin-polynotfound.herokuapp.com/',
'https://polynotfound.herokuapp.com/'
],
credentials: true
}));
const db = require("./models/mongodb.model");
console.log("Db Url: ",db.url);
db.mongoose