Initial Commit

This commit is contained in:
Domingo Dirutigliano
2022-06-11 21:57:50 +02:00
committed by DomySh
commit 372ade7d6f
43 changed files with 30381 additions and 0 deletions

14
frontend/src/js/utils.ts Executable file
View File

@@ -0,0 +1,14 @@
import { GeneralStats, Service } from "./models";
export async function getapi(path:string):Promise<any>{
return await fetch(`/api/${path}`).then( res => res.json() )
}
export async function generalstats():Promise<GeneralStats>{
return await getapi("general-stats") as GeneralStats;
}
export async function servicelist():Promise<Service[]>{
return await getapi("services") as Service[];
}