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