mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
fix worker.mjs for simple-json-server
This commit is contained in:
parent
d865a1e67d
commit
02f63bd14c
@ -9,9 +9,12 @@ const load = WebAssembly.instantiate(mod, go.importObject).then((instance) => {
|
|||||||
return instance;
|
return instance;
|
||||||
});
|
});
|
||||||
|
|
||||||
export default {
|
async function processRequest(event) {
|
||||||
async fetch(req) {
|
const req = event.request;
|
||||||
await load;
|
await load;
|
||||||
return handleRequest(req);
|
return handleRequest(req);
|
||||||
},
|
}
|
||||||
};
|
|
||||||
|
addEventListener("fetch", (event) => {
|
||||||
|
event.respondWith(processRequest(event));
|
||||||
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user