20 lines
454 B
JavaScript
20 lines
454 B
JavaScript
// UV Transports
|
|
importScripts('/epoxy/index.js');
|
|
|
|
importScripts('/uv/uv.bundle.js');
|
|
importScripts('/uv/uv.config.js');
|
|
importScripts(__uv$config.sw || '/uv/uv.sw.js');
|
|
|
|
const uv = new UVServiceWorker();
|
|
|
|
async function handleRequest(event) {
|
|
if (uv.route(event)) {
|
|
return await uv.fetch(event);
|
|
}
|
|
|
|
return await fetch(event.request)
|
|
}
|
|
|
|
self.addEventListener('fetch', (event) => {
|
|
event.respondWith(handleRequest(event));
|
|
}); |