mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
fix: broken demo sw
This commit is contained in:
parent
58d1c013ab
commit
e9035a18b2
1 changed files with 8 additions and 2 deletions
10
static/sw.js
10
static/sw.js
|
@ -14,11 +14,17 @@ importScripts(
|
||||||
|
|
||||||
const scramjet = new ScramjetServiceWorker();
|
const scramjet = new ScramjetServiceWorker();
|
||||||
|
|
||||||
self.addEventListener("fetch", async (event) => {
|
async function handleRequest(event) {
|
||||||
await scramjet.loadConfig();
|
await scramjet.loadConfig();
|
||||||
if (scramjet.route(event)) {
|
if (scramjet.route(event)) {
|
||||||
event.respondWith(scramjet.fetch(event));
|
return scramjet.fetch(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return fetch(event.request);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.addEventListener("fetch", (event) => {
|
||||||
|
event.respondWith(handleRequest(event));
|
||||||
});
|
});
|
||||||
|
|
||||||
let playgroundData;
|
let playgroundData;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue