export class Api { private base = "http://localhost:3000"; async get(path: any): Promise<any> { const r: any = await fetch(this.base + path); if (r.status != 200) { console.log("error"); return null; } return await r.json(); } async post(path: any, body: any): Promise<any> { return (await fetch(this.base + path, { method: "POST", body: body })) as any; } }