update README.md to use gonew cmd

This commit is contained in:
syumai 2023-10-11 23:32:15 +09:00
parent 8ebcc9fb0e
commit e86554aad6

View File

@ -68,13 +68,14 @@ First, please install the following tools:
* [wrangler](https://developers.cloudflare.com/workers/wrangler/)
- You can install it by running `npm install -g wrangler`.
* tinygo
* gonew command
- You can install it by running `go install golang.org/x/tools/cmd/gonew@latest`
After installation, please run the following commands.
```console
wrangler generate my-app syumai/workers/_templates/cloudflare/worker-tinygo
gonew github.com/syumai/workers/_templates/cloudflare/worker-tinygo your.module/my-app # e.g. github.com/syumai/my-app
cd my-app
go mod init
go mod tidy
make dev # start running dev server
curl http://localhost:8787/hello # outputs "Hello!"