mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
Fixes scope working under a path
- Adds proxy server for easy testing of scope under a path.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user