Skip to content

Commit

Permalink
Fix spa worker proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
G4brym committed Dec 15, 2024
1 parent 15553eb commit b031e7b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/worker/src/modules/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@ export async function dashboardRedirect(c: AppContext, next) {
const url = new URL(c.req.url);

if (!url.pathname.includes(".")) {
// This is required for SPA
return fetch(`${url.origin}/`, {
cf: {
// Always cache this fetch regardless of content type
// for a max of 60 seconds before revalidating the resource
cacheTtl: 60,
cacheEverything: true,
},
});
return c.env.ASSETS.fetch(new Request(url.origin));
}

await next();
Expand Down

0 comments on commit b031e7b

Please sign in to comment.