Go to file
Lorenzo Venerandi 7fa13b8f44 Update README.md
2025-01-06 16:45:56 +01:00
gen add runtime (nun va) 2024-12-14 02:26:04 +01:00
wit add runtime (nun va) 2024-12-14 02:26:04 +01:00
.gitignore generated dependencies 2024-12-14 01:30:44 +01:00
bindings.wadge.go fix dependencies 2024-12-14 01:56:22 +01:00
Dockerfile update deps 2025-01-04 23:58:51 +01:00
go.mod fix dependencies 2024-12-14 01:56:22 +01:00
go.sum fix dependencies 2024-12-14 01:56:22 +01:00
local.wadm.yaml update dependencies 2024-12-14 01:26:30 +01:00
main_test.go update dependencies 2024-12-14 01:26:30 +01:00
main.go Moved messaging handling to main 2025-01-04 23:58:31 +01:00
README.md Update README.md 2025-01-06 16:45:56 +01:00
task.go task template file 2025-01-04 23:58:45 +01:00
tools.go update dependencies 2024-12-14 01:26:30 +01:00
wadm.yaml changed names 2024-12-17 11:58:01 +01:00
wasmcloud.lock update component name 2024-12-14 02:26:26 +01:00
wasmcloud.toml update component name 2024-12-14 02:26:26 +01:00

HTTP Hello World

This is a simple TinyGo Wasm example that responds with a "Hello World" message for each request.

Prerequisites

  • go 1.23
  • tinygo 0.33
  • wash 0.35.0
  • wasmtime 25.0.0 (if running with wasmtime)

Building

wash build

Push OCI Artifact to Gitea

wash push gitea.rebus.ninja/lore/go-nats-client:1.x.x build/go_nats_stream_client_s.wasm 

Build and push to the registry using the dockerfile

Build the cointainer

docker build -t wash-image-build .

Build the component and push to the registry

First setup your credentials

export REG_USER=user && export REG_PASS=pass

Build and push

docker run --rm -e REGISTRY=gitea.rebus.ninja/lore/wasm-nats-stream-client:1.0.x -e WASH_REG_USER=$REG_USER -e WASH_REG_PASSWORD=$REG_PASS -v "$(pwd):/app" wash-image-build

Running with wasmtime

You must have wasmtime 25.0.0 for this to work. Make sure to follow the build step above first.

wasmtime serve -Scommon ./build/http_hello_world_s.wasm

Running with wasmCloud

Make sure to follow the build steps above, and replace the file path in the wadm manifest with the absolute path to your local built component.

wash up -d
wash app deploy ./wadm.yaml
curl http://localhost:8000

Adding Capabilities

To learn how to extend this example with additional capabilities, see the Adding Capabilities section of the wasmCloud documentation.