diff --git a/wasm/.gitignore b/wasm/.gitignore new file mode 100644 index 00000000..69e49086 --- /dev/null +++ b/wasm/.gitignore @@ -0,0 +1 @@ +/weshnet.wasm diff --git a/wasm/Makefile b/wasm/Makefile new file mode 100644 index 00000000..2d5ed974 --- /dev/null +++ b/wasm/Makefile @@ -0,0 +1,9 @@ +GO?=go1.19 + +.PHONY: serve +serve: weshnet.wasm + $(GO) run ./serve + +.PHONY: weshnet.wasm +weshnet.wasm: + GOOS=js GOARCH=wasm $(GO) build -o weshnet.wasm -tags nofuse . diff --git a/wasm/serve/main.go b/wasm/serve/main.go index a3e61c3a..85c427fc 100644 --- a/wasm/serve/main.go +++ b/wasm/serve/main.go @@ -1,7 +1,11 @@ package main -import "net/http" +import ( + "fmt" + "net/http" +) func main() { + fmt.Println("serving on :4242") http.ListenAndServe(`:4242`, http.FileServer(http.Dir(`.`))) }