Update: Cors

This commit is contained in:
Yûki VACHOT 2021-12-22 21:06:29 +01:00 committed by GitHub
parent 97b6039ce5
commit 6ce49daa9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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