Skip to content

Instantly share code, notes, and snippets.

@nkreiger
Last active December 29, 2020 17:49
Show Gist options
  • Save nkreiger/3536a6b4be1e6e6e553e000a896310d9 to your computer and use it in GitHub Desktop.
Save nkreiger/3536a6b4be1e6e6e553e000a896310d9 to your computer and use it in GitHub Desktop.
initial main.go in init branch
func main() {
// create anew http router
rtr := mux.NewRouter()
// health endpoint
rtr.HandleFunc("/health", services.Health).Methods(get)
// use go routinue to serve endpoint
ctx := context.Background()
GracefullyListenAndServe(ctx, addr, rtr)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment