Exported wsUrl constant from web-api-utils for the terminal component

This commit is contained in:
jpellizzari
2017-01-23 14:11:03 -08:00
parent 59ed9b8f3f
commit 0bf7fa49dd
3 changed files with 3 additions and 5 deletions

View File

@@ -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;

View File

@@ -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)}`;

View File

@@ -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",