Creates an executable called api in the build
directory.
go build -o build/golang_api_skel src/*
Designed to run inside a docker container.
Docker healthchecks curl /healthcheck
to see if app is alive.
Use docker to test
docker build -t golang_api_skel .
docker run -d --publish 6060:8080 --name test --rm golang_api_skel
Test the healthcheck
curl http://localhost:6060/healthcheck
Clean up
docker stop test
Return {"alive": true
. Great for testing. Note that the healthcheck is
not versioned.
curl http://localhost:8080/healthcheck
Return all items
curl http://localhost:8080/v0/items
Return single item
curl http://localhost:8080/v0/items/b379fdbaqj868olu1gi0
Note the example above will not work, you need to grab the UUID of one of the test items.
Add item
curl -H "Content-Type: application/json" -d '{"name":"soda"}' http://localhost:8080/v0/items
You can create a GitHub issue for any feature requests, bugs, or documentation improvements.
Where possible, please submit a pull request for the change.