20 lines
455 B
JavaScript

export class PuckoPruttApi {
constructor() {
this.apiUrl = "https://api.puckoprutt.tech"
this.schema = this.apiUrl + "/schema/"
}
_fetch_json(url) {
const response = await fetch(url);
if (!response.ok) {
return -1;
}
return await response.json();
}
dagens_lunch(spider) {
return this._fetch_json(this.apiUrl + "/dagens_lunch/" + spider + "/?format=json");
}
}