Created
August 22, 2018 15:58
-
-
Save nosequeldeebee/753dce1dd58ad7ea1d14e881c90e834c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// makeMuxRouter defines and creates routes | |
func makeMuxRouter() http.Handler { | |
muxRouter := mux.NewRouter() | |
muxRouter.HandleFunc("/{id}", handleGetTweets).Methods("GET") | |
return muxRouter | |
} | |
func respondWithError(err error, w http.ResponseWriter) { | |
log.Println(err) | |
w.WriteHeader(500) | |
w.Write([]byte(err.Error())) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment