From b9278b63e576f0d95c399ce0416b150cb439602f Mon Sep 17 00:00:00 2001 From: "mati108@gmail.com" <34651529+matbenitez@users.noreply.github.com> Date: Sat, 3 Nov 2018 13:01:11 -0300 Subject: [PATCH 1/2] reducing URL definitions --- AABrowserAPI/TeamSetup.js | 12 ++---------- Server/Exchange/ExchangeAPI.js | 5 +++-- TopSpace/Login.js | 7 ++++--- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/AABrowserAPI/TeamSetup.js b/AABrowserAPI/TeamSetup.js index 6683a74ba..26fa7338f 100644 --- a/AABrowserAPI/TeamSetup.js +++ b/AABrowserAPI/TeamSetup.js @@ -524,11 +524,7 @@ const graphqlClient = require('graphql-client') const usersModuleAPI = graphqlClient({ - //url: 'http://localhost:4000/graphql' - url: 'https://app-api.advancedalgos.net/graphql', - //headers: { - // Authorization: 'Bearer ' + authToken - //} + url: window.MASTER_APP_API }); @@ -1017,11 +1013,7 @@ const graphqlClient = require('graphql-client') const usersModuleAPI = graphqlClient({ - //url: 'http://localhost:4000/graphql' - url: 'https://app-api.advancedalgos.net/graphql', - //headers: { - // Authorization: 'Bearer ' + authToken - //} + url: window.MASTER_APP_API }); diff --git a/Server/Exchange/ExchangeAPI.js b/Server/Exchange/ExchangeAPI.js index 6cd8a0f80..bdffa2ddb 100644 --- a/Server/Exchange/ExchangeAPI.js +++ b/Server/Exchange/ExchangeAPI.js @@ -9,8 +9,9 @@ const isValidOrder = require('./exchangeUtils').isValidOrder; const graphqlClient = require('graphql-client') - const MASTER_APP_API = 'https://app-api.advancedalgos.net/graphql'; - + //const MASTER_APP_API = 'https://app-api.advancedalgos.net/graphql'; + const MASTER_APP_API = 'http://localhost:4100/graphql'; + let MODULE_NAME = "Exchange API"; let thisObject = { diff --git a/TopSpace/Login.js b/TopSpace/Login.js index 39013d97f..357aa96ef 100644 --- a/TopSpace/Login.js +++ b/TopSpace/Login.js @@ -21,7 +21,8 @@ function newLogin() { container.isDraggeable = false; container.isClickeable = true; - const MASTER_APP_API = 'https://app-api.advancedalgos.net/graphql'; + //window.MASTER_APP_API = 'https://app-api.advancedalgos.net/graphql'; + window.MASTER_APP_API = 'http://localhost:4100/graphql'; let currentLabel; @@ -52,7 +53,7 @@ function newLogin() { const apolloClient = new Apollo.lib.ApolloClient({ networkInterface: Apollo.lib.createNetworkInterface({ - uri: MASTER_APP_API, + uri: window.MASTER_APP_API, transportBatching: true, }), connectToDevTools: true, @@ -104,7 +105,7 @@ function newLogin() { } const networkInterfaceTeams = Apollo.lib.createNetworkInterface({ - uri: MASTER_APP_API + uri: window.MASTER_APP_API }); networkInterfaceTeams.use([{ From 2c1fcbdbe86bc7f5243d662c193f657dd8fe543f Mon Sep 17 00:00:00 2001 From: "mati108@gmail.com" <34651529+matbenitez@users.noreply.github.com> Date: Sat, 3 Nov 2018 13:05:06 -0300 Subject: [PATCH 2/2] reducing places for the URL --- AABrowserAPI/TeamSetup.js | 4 ++-- TopSpace/Login.js | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/AABrowserAPI/TeamSetup.js b/AABrowserAPI/TeamSetup.js index 26fa7338f..fc452151f 100644 --- a/AABrowserAPI/TeamSetup.js +++ b/AABrowserAPI/TeamSetup.js @@ -524,7 +524,7 @@ const graphqlClient = require('graphql-client') const usersModuleAPI = graphqlClient({ - url: window.MASTER_APP_API + url: window.canvasApp.urlPrefix }); @@ -1013,7 +1013,7 @@ const graphqlClient = require('graphql-client') const usersModuleAPI = graphqlClient({ - url: window.MASTER_APP_API + url: window.canvasApp.urlPrefix }); diff --git a/TopSpace/Login.js b/TopSpace/Login.js index 357aa96ef..f5acb5855 100644 --- a/TopSpace/Login.js +++ b/TopSpace/Login.js @@ -21,9 +21,6 @@ function newLogin() { container.isDraggeable = false; container.isClickeable = true; - //window.MASTER_APP_API = 'https://app-api.advancedalgos.net/graphql'; - window.MASTER_APP_API = 'http://localhost:4100/graphql'; - let currentLabel; let userAuthorization; @@ -53,7 +50,7 @@ function newLogin() { const apolloClient = new Apollo.lib.ApolloClient({ networkInterface: Apollo.lib.createNetworkInterface({ - uri: window.MASTER_APP_API, + uri: window.canvasApp.urlPrefix, transportBatching: true, }), connectToDevTools: true, @@ -105,7 +102,7 @@ function newLogin() { } const networkInterfaceTeams = Apollo.lib.createNetworkInterface({ - uri: window.MASTER_APP_API + uri: window.canvasApp.urlPrefix }); networkInterfaceTeams.use([{