Added plan by id route and error handling and organisation

This commit is contained in:
2021-01-01 08:41:17 -06:00
parent bbb0cf3f42
commit 95d945dda7
6 changed files with 162 additions and 9 deletions

View File

@@ -10,3 +10,12 @@ func serverError(w http.ResponseWriter, err error) {
log.Printf("received error: {%v}", err)
http.Error(w, http.StatusText(code), code)
}
func methodNotAllowedHandler(w http.ResponseWriter, r *http.Request) {
code := http.StatusMethodNotAllowed
http.Error(w, http.StatusText(code), code)
}
func notFoundHandler(w http.ResponseWriter, r *http.Request) {
code := http.StatusNotFound
http.Error(w, http.StatusText(code), code)
}