This TinyGo-based server serves the /favicon.ico
request for a webserver. It is a minimal example of writing a Spin application with WASI tools.
Prerequisites:
- A recent version of Go
- A recent version of TinyGo
- A recent version of Spin
Use make build
to build, and make serve
to start a Spin instance serving /favicon.ico
.
Use CTRL-C
to stop the server.
At the time of this writing, Spin has not been released publicly, so the
go.mod
file has areplace
line. When Spin is available publicly, thereplace
line should be removed. In the meantime, you will need to fetchspin
from source and then adjust the path ingo.mod
.
By default, this looks for a favicon.ico
file in the location /favicon.ico
(see spin.toml
for file mapping).
To set this to a different path, use spin up -e FAVICON_PATH=/path/to/favicon.ico