Mark Duppenthaler
Added basic file loading
0b598b9
raw
history blame
431 Bytes
class API {
static async fetchIndex(): Promise<string> {
const response = await fetch("/");
if (!response.ok) throw new Error("Failed to fetch index.html");
return response.text();
}
static async fetchStaticFile(path: string): Promise<string> {
const response = await fetch(`/${path}`);
if (!response.ok) throw new Error(`Failed to fetch ${path}`);
return response.text();
}
}
export default API;