diff --git a/src/webpage/home.ts b/src/webpage/home.ts index 9f41e77..ce94e44 100644 --- a/src/webpage/home.ts +++ b/src/webpage/home.ts @@ -7,22 +7,22 @@ fetch("/instances.json") .then( ( json: { -name: string; -description?: string; -descriptionLong?: string; -image?: string; -url?: string; -display?: boolean; -online?: boolean; -uptime: { alltime: number; daytime: number; weektime: number }; -urls: { -wellknown: string; -api: string; -cdn: string; -gateway: string; -login?: string; -}; -}[] + name: string; + description?: string; + descriptionLong?: string; + image?: string; + url?: string; + display?: boolean; + online?: boolean; + uptime: { alltime: number; daytime: number; weektime: number }; + urls: { + wellknown: string; + api: string; + cdn: string; + gateway: string; + login?: string; + }; + }[] )=>{ console.warn(json); for(const instance of json){ @@ -77,8 +77,7 @@ login?: string; div.append(statbox); div.onclick = _=>{ if(instance.online){ - window.location.href = -"/register.html?instance=" + encodeURI(instance.name); + window.location.href = "/register.html?instance=" + encodeURI(instance.name); }else{ alert("Instance is offline, can't connect"); } diff --git a/src/webpage/service.ts b/src/webpage/service.ts index c1f494b..5c2f0a3 100644 --- a/src/webpage/service.ts +++ b/src/webpage/service.ts @@ -93,7 +93,9 @@ async function getfile(event: FetchEvent):Promise{ } let path=toPath(event.request.url); - + if(path === "/instances.json"){ + return await fetch(path); + } console.log("Getting path: "+path); const responseFromCache = await caches.match(path); if(responseFromCache){