From f243bb3710560b1c34cd1791aaf5d1d96376bded Mon Sep 17 00:00:00 2001 From: Juan D Date: Wed, 11 Jan 2017 21:20:10 +0100 Subject: [PATCH 1/3] Add CORS headers to microservice --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index efdd0b7..4a7e738 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ const { pushView } = require('./utils') module.exports = async function (req, res) { const { pathname, query } = url.parse(req.url, /* parseQueryString */ true) + res.setHeader('Access-Control-Allow-Origin', '*') // Send all views down if "?all" is true if (String(query.all) === 'true') { const data = { From 04f5916f4c9ad996a63e56549b0850b45a016ca7 Mon Sep 17 00:00:00 2001 From: Juan D Date: Thu, 12 Jan 2017 09:26:08 +0100 Subject: [PATCH 2/3] Update index.js --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 4a7e738..451a859 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,7 @@ const { pushView } = require('./utils') module.exports = async function (req, res) { const { pathname, query } = url.parse(req.url, /* parseQueryString */ true) res.setHeader('Access-Control-Allow-Origin', '*') + res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept") // Send all views down if "?all" is true if (String(query.all) === 'true') { const data = { From 9c7e3267ec1a3a40272e814df9d1dfe6e37e3144 Mon Sep 17 00:00:00 2001 From: juandjara Date: Thu, 12 Jan 2017 16:39:46 +0100 Subject: [PATCH 3/3] Revert "Update index.js" This reverts commit 04f5916f4c9ad996a63e56549b0850b45a016ca7. --- src/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.js b/src/index.js index 451a859..4a7e738 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,6 @@ const { pushView } = require('./utils') module.exports = async function (req, res) { const { pathname, query } = url.parse(req.url, /* parseQueryString */ true) res.setHeader('Access-Control-Allow-Origin', '*') - res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept") // Send all views down if "?all" is true if (String(query.all) === 'true') { const data = {