Skip to content

Commit

Permalink
fix hardcoded backend path to dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
david-loe committed Feb 27, 2025
1 parent 0d2e480 commit 4f6f891
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"short_name": "abrechnung",
"start_url": "/user",
"scope": "/",
"start_url": "./user",
"scope": "./",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#ffffff",
Expand Down
7 changes: 6 additions & 1 deletion frontend/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ clientsClaim()
//default caching strategy - no caching only using network
setDefaultHandler(new NetworkOnly())
// to allow work offline - setting default entry point for app
registerRoute(new NavigationRoute(createHandlerBoundToURL('index.html'), { denylist: [/^\/backend\/auth/, /\/report(?:\?|$)/] }))
const denylist = [/\/report(?:\?|$)/]
if (import.meta.env.VITE_BACKEND_URL.startsWith(import.meta.env.VITE_FRONTEND_URL)) {
const backendPath = import.meta.env.VITE_BACKEND_URL.replace(import.meta.env.VITE_FRONTEND_URL, '')
denylist.push(new RegExp(`^${backendPath}/auth`))
}
registerRoute(new NavigationRoute(createHandlerBoundToURL('index.html'), { denylist }))

//caching all fonts with StaleWhileRevalidat strategy
registerRoute(
Expand Down

0 comments on commit 4f6f891

Please sign in to comment.