mirror of
https://github.com/nlepage/go-wasm-http-server.git
synced 2025-03-10 17:29:10 +00:00
⚗️
This commit is contained in:
parent
410cde261b
commit
305a51fe51
4
sw.js
4
sw.js
@ -28,7 +28,9 @@ function registerWasmHTTPListener(wasm, base, args = []) {
|
||||
go.env = { WASMHTTP_HANDLER_ID: handlerId, WASMHTTP_PATH: path }
|
||||
go.argv = [wasm, ...args]
|
||||
// FIXME await ? catch ?
|
||||
WebAssembly.instantiate(wasmPromise, go.importObject).then(({ instance }) => go.run(instance))
|
||||
wasmPromise
|
||||
.then(wasm => WebAssembly.instantiate(wasm, go.importObject))
|
||||
.then(({ instance }) => go.run(instance))
|
||||
|
||||
e.respondWith(handlerPromise.then(handler => handler(e.request)))
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user