endpoint slashes

This commit is contained in:
penner 2022-12-22 00:15:59 +00:00
parent e53619ebcf
commit cb7c785ef4

View file

@ -27,6 +27,9 @@ export class Advent22 {
if (endpoint === undefined) if (endpoint === undefined)
return this.api_baseurl; return this.api_baseurl;
while (endpoint.startsWith('/'))
endpoint = endpoint.substring(1);
return `${this.api_baseurl}/${endpoint}`; return `${this.api_baseurl}/${endpoint}`;
} }
@ -92,8 +95,6 @@ export class Advent22 {
on_success: (data: number) => void, on_success: (data: number) => void,
): void { ): void {
this.api_get<number>( this.api_get<number>(
/**Explodiert Möglicherweise */
// oder auch nicht
endpoint, endpoint,
(data: number) => { (data: number) => {
on_success(data); on_success(data);