Skip to content

Instantly share code, notes, and snippets.

@rafa-acioly
Created February 4, 2018 13:01
Show Gist options
  • Save rafa-acioly/76113ca8c7e4e50a52e7647609cb4817 to your computer and use it in GitHub Desktop.
Save rafa-acioly/76113ca8c7e4e50a52e7647609cb4817 to your computer and use it in GitHub Desktop.
func main() {
router := mux.NewRouter()
router.HandleFunc("/contato", GetPeople).Methods("GET")
router.HandleFunc("/contato/{id}", GetPerson).Methods("GET")
router.HandleFunc("/contato/{id}", CreatePerson).Methods("POST")
router.HandleFunc("/contato/{id}", DeletePerson).Methods("DELETE")
log.Fatal(http.ListenAndServe(":8000", router))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment