From da026a3003e59c04b0e507c3d153b1af8810650d Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sat, 3 Mar 2018 22:51:16 -0500 Subject: [PATCH] a better solution than renaming all the paths --- apiProxyMiddleware.js | 9 ++++----- public/index.html | 1 + src/Metamaps/Cable.js | 8 ++++---- src/Metamaps/Create.js | 8 ++++---- src/Metamaps/DataModel/Map.js | 2 +- src/Metamaps/DataModel/Mapper.js | 2 +- src/Metamaps/DataModel/MapperCollection.js | 2 +- src/Metamaps/DataModel/Mapping.js | 2 +- src/Metamaps/DataModel/MappingCollection.js | 2 +- src/Metamaps/DataModel/Message.js | 2 +- src/Metamaps/DataModel/MessageCollection.js | 2 +- src/Metamaps/DataModel/MetacodeCollection.js | 2 +- src/Metamaps/DataModel/Synapse.js | 2 +- src/Metamaps/DataModel/SynapseCollection.js | 2 +- src/Metamaps/DataModel/Topic.js | 2 +- src/Metamaps/DataModel/TopicCollection.js | 2 +- src/Metamaps/GlobalUI/Notifications.js | 6 +++--- src/Metamaps/GlobalUI/Search.js | 6 +++--- src/Metamaps/Import.js | 2 +- src/Metamaps/Map/InfoBox.js | 8 ++++---- src/Metamaps/Map/index.js | 10 +++++----- src/Metamaps/Mapper.js | 2 +- src/Metamaps/Realtime/sendable.js | 2 +- src/Metamaps/Synapse.js | 2 +- src/Metamaps/SynapseCard.js | 2 +- src/Metamaps/Topic.js | 8 ++++---- src/Metamaps/Views/ContextMenu.js | 2 +- src/Metamaps/Views/ExploreMaps.js | 8 ++++---- 28 files changed, 54 insertions(+), 54 deletions(-) diff --git a/apiProxyMiddleware.js b/apiProxyMiddleware.js index f049c1db..f0c34fc4 100644 --- a/apiProxyMiddleware.js +++ b/apiProxyMiddleware.js @@ -1,13 +1,12 @@ -import request from 'request' +const request = require('request') function apiProxyMiddleware (req, res, next) { - if (true) { // is application/json + if (!req.xhr) { return next() } - console.log(req.get('Content-Type')) const method = req.method.toLowerCase() req.pipe( - request[method](url, { + request[method](process.env.API + req.originalUrl, { headers: { ...req.headers, host: process.env.API @@ -18,4 +17,4 @@ function apiProxyMiddleware (req, res, next) { .pipe(res) } -export default apiProxyMiddleware \ No newline at end of file +module.exports = apiProxyMiddleware \ No newline at end of file diff --git a/public/index.html b/public/index.html index 86d8a5aa..230c865d 100644 --- a/public/index.html +++ b/public/index.html @@ -71,6 +71,7 @@