From 9b90537d1fe1686b3e3d950992adfb7d687a3b50 Mon Sep 17 00:00:00 2001 From: walamana Date: Thu, 23 Aug 2018 15:28:47 +0200 Subject: [PATCH] Added Access-Control-Allow-Credentials header and set it to true Signed-off-by: walamana --- app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index cb16e8e..de1efc4 100644 --- a/app.js +++ b/app.js @@ -17,7 +17,7 @@ const corsWhitelist = [ "http://minis.walamana.de", "localhost:80", "http://localhost:80", "http://localhost:4200", - undefined] + undefined] // FIXME: REMOVE THIS AFTER DEBUGGING! var bodyParser = require('body-parser') @@ -56,6 +56,13 @@ con.connect(err => { 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) => { console.log(con);