diff --git a/docs/api.go b/docs/hello/api.go similarity index 78% rename from docs/api.go rename to docs/hello/api.go index 887e569..0c0ae18 100644 --- a/docs/api.go +++ b/docs/hello/api.go @@ -1,7 +1,6 @@ package main import ( - "context" "encoding/json" "fmt" "net/http" @@ -10,8 +9,6 @@ import ( ) func main() { - defer fmt.Println("api stopping...") - http.HandleFunc("/hello", func(res http.ResponseWriter, req *http.Request) { params := make(map[string]string) if err := json.NewDecoder(req.Body).Decode(¶ms); err != nil { @@ -25,8 +22,7 @@ func main() { } }) - var release = wasmhttp.Serve(nil) - defer release() + wasmhttp.Serve(nil) - <-context.Background().Done() + select {} } diff --git a/docs/api.wasm b/docs/hello/api.wasm similarity index 58% rename from docs/api.wasm rename to docs/hello/api.wasm index 46b3538..9d414c0 100755 Binary files a/docs/api.wasm and b/docs/hello/api.wasm differ diff --git a/docs/index.html b/docs/hello/index.html similarity index 64% rename from docs/index.html rename to docs/hello/index.html index 7893b24..51c2ad5 100644 --- a/docs/index.html +++ b/docs/hello/index.html @@ -3,15 +3,7 @@ go-wasm-http-server demo