[feature] Merged with api-prototype

This commit is contained in:
PB
2022-06-19 15:19:05 +02:00
parent 748b631d0c
commit c44ec98e39
16 changed files with 534 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
package handler
import "net/http"
type NotFoundHandler struct{}
func (NotFoundHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
encodeResponse(w, &response{http.StatusNotFound, "Path " + r.RequestURI + " not found"}, nil)
}
type MethodNotAllowedHandler struct{}
func (MethodNotAllowedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
encodeResponse(w, &response{http.StatusMethodNotAllowed, "Method Not Allowed: " + r.Method}, nil)
}