Added Access-Control-Allow-Credentials header and set it to true

Signed-off-by: walamana <joniogerg@gmail.com>
This commit is contained in:
walamana 2018-08-23 15:28:47 +02:00
parent 819b8e9c78
commit 9b90537d1f

9
app.js
View File

@ -17,7 +17,7 @@ const corsWhitelist = [ "http://minis.walamana.de",
"localhost:80", "localhost:80",
"http://localhost:80", "http://localhost:80",
"http://localhost:4200", "http://localhost:4200",
undefined] undefined] // FIXME: REMOVE THIS AFTER DEBUGGING!
var bodyParser = require('body-parser') var bodyParser = require('body-parser')
@ -56,6 +56,13 @@ con.connect(err => {
console.log("Connected to database!"); console.log("Connected to database!");
}); });
// Global headers
app.get('/*',function(req,res,next){
res.header('Access-Control-Allow-Credentials' , true );
next();
});
app.get('/', (req, res) => { app.get('/', (req, res) => {
console.log(con); console.log(con);