From b948c3891bfe5cd829ad361e70f2efeed04e2fed Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 1 Oct 2019 14:27:58 +0200 Subject: [PATCH] Virtual port injected into index html --- index.html | 2 +- server.js | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 4f862caf1..0cfe1ecfa 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ executingAt: 'Local', visible: true, topMargin: 60, - urlPrefix: 'http://localhost:9999/', + urlPrefix: 'http://localhost:VIRTUAL_PORT/', graphQL: { masterAppApiUrl: 'https://demo-api-dev.superalgos.org/graphql', }, diff --git a/server.js b/server.js index a99b24051..ab4136da9 100644 --- a/server.js +++ b/server.js @@ -404,12 +404,7 @@ function onBrowserRequest (request, response) { try { let fileContent = file.toString() - /* The second request parameters is the sessionToken, if it exists. */ - - if (requestParameters[2] !== '' && requestParameters[2] !== undefined) { - fileContent = fileContent.replace("window.canvasApp.sessionToken = ''", "window.canvasApp.sessionToken = '" + requestParameters[2] + "'") - } - + fileContent = fileContent.replace('VIRTUAL_PORT', process.env.VIRTUAL_PORT) respondWithContent(fileContent, response) } catch (err) { console.log('[ERROR] server -> onBrowserRequest -> File Not Found: ' + fileName + ' or Error = ' + err.stack)