Erster Docker-Stand

This commit is contained in:
Ali
2026-02-20 16:06:40 +09:00
commit f31e2e8ed3
8818 changed files with 1605323 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
// src/adapter/service-worker/handler.ts
var handle = (app, opts = {
// To use `fetch` on a Service Worker correctly, bind it to `globalThis`.
fetch: globalThis.fetch.bind(globalThis)
}) => {
return (evt) => {
evt.respondWith(
(async () => {
const res = await app.fetch(evt.request, {}, evt);
if (opts.fetch && res.status === 404) {
return await opts.fetch(evt.request);
}
return res;
})()
);
};
};
export {
handle
};

View File

@@ -0,0 +1,11 @@
// src/adapter/service-worker/index.ts
import { handle } from "./handler.js";
var fire = (app, options = {
fetch: void 0
}) => {
addEventListener("fetch", handle(app, options));
};
export {
fire,
handle
};

View File