service example
Install
go get github.com/gomatic/service-example
Test
Run the service
API_PORT=5000 service-example --debug >service-example.log 2>&1 & service_pid=$!
Test the service
curl -s localhost:5000/health # The health check
curl -s localhost:5000/api/model.json # The OpenAPI documentation
debug routes
curl -s localhost:4999/debug/vars # This debug route provides runtime information
RPC
Install RPC client helper
go get github.com/gomatic/service-example/cmd/service-example-client
Call the service through the RPC using the client helper
API_PORT=5000 service-example-client this is a great example message
Cleanup
kill ${service_pid}
rm service-example.log # Maybe have a look at the log before doing this.