fix server url

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-08-09 20:15:40 +02:00
parent e4cc53966a
commit 2c60e39bae
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0

View File

@ -31,9 +31,9 @@ export default async () => {
GetClient: async (token: string, endpoint: string): Promise<Client> => {
if (client === undefined) {
return await createClient((handler: TxHander) => {
const url = `${endpoint}/${token}`
console.log('connecting to', url)
return connect(url, handler)
const url = new URL(`/${token}`, endpoint)
console.log('connecting to', url.href)
return connect(url.href, handler)
})
}
return client