Simple golang REST API boilerplate with service discovery and remote config supported by Consul.
Things that you need to do before running this boilerplate:
- Make sure, your consul service already running.
- Provide your configuration in consul KV. For more details see this post.
- If you're not using consul, please provide local configuration file by rename
.app-config.example.yamlto.app-config.yaml.
Run command below:
$ go build -o boilerplate .
$ ./boilerplate serveHttp --consul localhost:8500 In this case, consul service run at port 8500 by default.
Try hit this endpoint
curl --location --request GET 'http://localhost:8080/v1/ping'Copyright © 2020, Bareksa Portal Investasi. Released under the MIT License.