Revert "⚗️"

This reverts commit d1781bb693.
This commit is contained in:
Nicolas Lepage
2021-01-22 01:36:15 +01:00
parent 0d50eee990
commit c1fcadf0f8
5 changed files with 10 additions and 42 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"context"
"encoding/json"
"fmt"
"net/http"
@@ -9,7 +10,7 @@ import (
)
func main() {
defer fmt.Println("api stopped...")
defer fmt.Println("api stopping...")
http.HandleFunc("/hello", func(res http.ResponseWriter, req *http.Request) {
params := make(map[string]string)
@@ -24,5 +25,8 @@ func main() {
}
})
wasmhttp.Serve(nil)
var release = wasmhttp.Serve(nil)
defer release()
<-context.Background().Done()
}

Binary file not shown.

View File

@@ -8,4 +8,4 @@ addEventListener('activate', event => {
event.waitUntil(clients.claim())
})
registerWasmHTTPListener('api.wasm', { base: 'api' })
registerWasmHTTPListener('api.wasm', 'api')