diff --git a/client/app/scripts/components/terminal.js b/client/app/scripts/components/terminal.js index ed9133c36..55b2219aa 100644 --- a/client/app/scripts/components/terminal.js +++ b/client/app/scripts/components/terminal.js @@ -9,10 +9,8 @@ import Term from 'xterm'; import { clickCloseTerminal } from '../actions/app-actions'; import { getNeutralColor } from '../utils/color-utils'; import { setDocumentTitle } from '../utils/title-utils'; -import { getPipeStatus, basePath, doResizeTty } from '../utils/web-api-utils'; +import { getPipeStatus, doResizeTty, wsUrl } from '../utils/web-api-utils'; -const wsProto = location.protocol === 'https:' ? 'wss' : 'ws'; -const wsUrl = `${wsProto}://${location.host}${basePath(location.pathname)}`; const log = debug('scope:terminal'); const DEFAULT_COLS = 80; diff --git a/client/app/scripts/utils/web-api-utils.js b/client/app/scripts/utils/web-api-utils.js index e7ffbcd24..1a858d2c3 100644 --- a/client/app/scripts/utils/web-api-utils.js +++ b/client/app/scripts/utils/web-api-utils.js @@ -63,7 +63,7 @@ const API_PATH = basePathSlash(window.location.pathname) === '/' : `/api${window.location.pathname}/api`; const wsProto = location.protocol === 'https:' ? 'wss' : 'ws'; -const wsUrl = basePathSlash(window.location.pathname) === '/' +export const wsUrl = basePathSlash(window.location.pathname) === '/' ? `${wsProto}://${location.host}${basePath(window.location.pathname)}` : `${wsProto}://${location.host}/api${basePath(window.location.pathname)}`; diff --git a/client/package.json b/client/package.json index 86bb7ce5d..c811a738b 100644 --- a/client/package.json +++ b/client/package.json @@ -90,7 +90,7 @@ "scripts": { "build": "webpack --config webpack.production.config.js", "build-external": "EXTERNAL=true webpack --config webpack.production.config.js", - "build-pkg": "babel app/scripts --ignore __tests__ --out-dir dist && cp -R app/styles dist/styles", + "build-pkg": "babel app/scripts --ignore __tests__ --out-dir dist && cp -R app/styles dist", "install": "./post-install", "start": "node server.js", "start-production": "NODE_ENV=production node server.js",