This commit is contained in:
Nicolas Lepage
2021-01-21 23:23:27 +01:00
parent 28bf05797e
commit 0bc6fbc825
4 changed files with 33 additions and 29 deletions

View File

@@ -22,5 +22,7 @@ func main() {
}
})
fmt.Println("Calling ServeOnce")
wasmhttp.ServeOnce(nil)
}

Binary file not shown.

View File

@@ -1,3 +1,11 @@
importScripts('https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@048825e2c7dd6b9dcfe3462105f4364ffc70663c/sw.js')
addEventListener('install', (event) => {
event.waitUntil(skipWaiting())
})
addEventListener('activate', event => {
event.waitUntil(clients.claim())
})
registerWasmHTTPListener('api.wasm')