mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
16 lines
No EOL
511 B
JavaScript
16 lines
No EOL
511 B
JavaScript
importScripts("scramjet.codecs.js");
|
|
importScripts("scramjet.config.js");
|
|
importScripts( __scramjet$config.bundle || "scramjet.bundle.js")
|
|
importScripts( __scramjet$config.worker || "scramjet.worker.js");
|
|
|
|
const scramjet = new ScramjetServiceWorker();
|
|
|
|
self.addEventListener("fetch", async (event) => {
|
|
event.respondWith((async() => {
|
|
if (scramjet.route(event)) {
|
|
return await scramjet.fetch(event);
|
|
} else {
|
|
return await fetch(event.request);
|
|
}
|
|
})())
|
|
})
|