Added plan by id route and error handling and organisation
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user