Skip to content

Bareksa/rest-api-boilerplate

Repository files navigation

Golang REST API Boilerplate

forthebadge

Simple golang REST API boilerplate with service discovery and remote config supported by Consul.

Prerequisite

Things that you need to do before running this boilerplate:

  1. Make sure, your consul service already running.
  2. Provide your configuration in consul KV. For more details see this post.
  3. If you're not using consul, please provide local configuration file by rename .app-config.example.yaml to .app-config.yaml.

How to run

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'

License

Copyright © 2020, Bareksa Portal Investasi. Released under the MIT License.

About

Simple REST API Golang Boilerplate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages