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
ee59e565e8
commit
cea18c5f76
3
sw.js
3
sw.js
@ -27,9 +27,8 @@ function registerWasmHTTPListener(wasm, base, args = []) {
|
||||
const go = new Go()
|
||||
go.env = { WASMHTTP_HANDLER_ID: handlerId, WASMHTTP_PATH: path }
|
||||
go.argv = [wasm, ...args]
|
||||
const { instance } = await WebAssembly.instantiateStreaming(wasmPromise, go.importObject)
|
||||
// FIXME await ? catch ?
|
||||
go.run(instance)
|
||||
WebAssembly.instantiateStreaming(wasmPromise, go.importObject).then(({ instance }) => go.run(instance))
|
||||
|
||||
e.respondWith(handlerPromise.then(handler => handler(e.request)))
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user