feat: prefer IMGW ALARO forecast data

This commit is contained in:
zv
2026-06-02 20:23:55 +02:00
parent ad4248efdf
commit b97a1cf1ea
11 changed files with 371 additions and 69 deletions

View File

@@ -1,4 +1,4 @@
const CACHE_NAME = "wtr-shell-v2";
const CACHE_NAME = "wtr-shell-v3";
const SHELL = ["/", "/offline", "/manifest.json", "/icons/icon.svg", "/icons/maskable.svg", "/icons/icon-192.png", "/icons/icon-512.png", "/icons/maskable-512.png"];
self.addEventListener("install", (event) => {
@@ -16,7 +16,7 @@ self.addEventListener("activate", (event) => {
self.addEventListener("fetch", (event) => {
if (event.request.method !== "GET") return;
const url = new URL(event.request.url);
if (url.pathname.startsWith("/api/imgw/") || url.pathname === "/api/imgw-current") {
if (url.pathname.startsWith("/api/imgw/") || url.pathname === "/api/imgw-current" || url.pathname === "/api/forecast") {
event.respondWith(
fetch(event.request)
.then((response) => {