From a97781c847744e417ada125a6f5288f3d54ab67c Mon Sep 17 00:00:00 2001 From: Norman Meier Date: Mon, 10 Jun 2024 16:58:12 +0200 Subject: [PATCH] chore: add makefile Signed-off-by: Norman Meier --- wasm/.gitignore | 1 + wasm/Makefile | 9 +++++++++ wasm/serve/main.go | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 wasm/.gitignore create mode 100644 wasm/Makefile 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(`.`))) }