This repository includes some realstic examples of using popular go web frameworks:
Starting the 4 different examples can be done like follows:
echo (port 8080
):
go run ./cmd/echo
fiber (port 8081
):
go run ./cmd/fiber
gin (port 8082
):
go run ./cmd/gin
httprouter (port 8083
):
go run ./cmd/httprouter
Start the statsd lister with docker-compose:
docker-compose up -d
and follow the logs:
docker-compose logs -f
These commands use httpie. Though I prefer the go version, as it starts super quick, unlike the Python one.
Example command for /v1/bananas
:
http localhost:8080/v1/bananas
Example command for /v1/banana/:id
:
http localhost:8080/v1/banana/1234
Example command for /v1/admin
with basic auth:
http -a foo:bar POST localhost:8080/v1/admin value=hello