Fixes scope working under a path

- Adds proxy server for easy testing of scope under a path.
This commit is contained in:
Simon Howe
2016-02-18 14:17:51 +01:00
parent 07d34205ce
commit ac5d258378
7 changed files with 58 additions and 8 deletions

View File

@@ -45,6 +45,16 @@ export function basePath(urlPath) {
return parts.join('/').replace(/\/$/, '');
}
export function basePathSlash(urlPath) {
//
// "/scope/terminal.html" -> "/scope/"
// "/scope/" -> "/scope/"
// "/scope" -> "/scope/"
// "/" -> "/"
//
return basePath(urlPath) + '/';
}
const wsProto = location.protocol === 'https:' ? 'wss' : 'ws';
const wsUrl = wsProto + '://' + location.host + basePath(location.pathname);