Add `customCDNEndpoint` param to Client constructor

This commit is contained in:
Roj Serbest 2021-10-18 19:08:34 +03:00
parent 77648fdb22
commit c98be4bd1b
1 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,7 @@ export class Client extends BaseClient {
constructor(
store: Memory | FileName | LocalStorageKey | Store = "main",
rpcEndpoint = "http://socialvoid.qlg1.com:5601",
public customCDNEndpoint?: string,
) {
super(rpcEndpoint);
@ -50,6 +51,10 @@ export class Client extends BaseClient {
}
async getCDNEndpoint(): Promise<string> {
if (this.customCDNEndpoint) {
return this.customCDNEndpoint;
}
return (await this.help.getServerInformation()).cdn_server;
}