use common vars in router, minor clean up (#551)

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman authored and GitHub committed 2020-07-02 17:21:38 +03:00
1 parent 336daea333
commit d90be46a1f
4 files changed
+53 -35

No files matched your search

+1 -2
View File
@@ -50,7 +50,6 @@ export class TerminalApi extends WebSocketApi {
async getUrl(token: string) {
const { hostname, protocol } = location;
let { port } = location;
const prefix = apiPrefix.TERMINAL;
const { id, node } = this.options;
const wss = `ws${protocol === "https:" ? "s" : ""}://`;
const queryParams = { token, id };
@@ -63,7 +62,7 @@ export class TerminalApi extends WebSocketApi {
type: "node"
});
}
return `${wss}${hostname}${port}${prefix}/api?${stringify(queryParams)}`;
return `${wss}${hostname}${port}/api?${stringify(queryParams)}`;
}
async connect() {