all: mv v1 to next; imp tests, docs

This commit is contained in:
Ainar Garipov
2022-09-09 14:25:48 +03:00
parent d74ba3cb9d
commit dbfc8ae362
26 changed files with 122 additions and 87 deletions

View File

@@ -0,0 +1,16 @@
package websvc
import "net/http"
// Middlewares
// jsonMw sets the content type of the response to application/json.
func jsonMw(h http.Handler) (wrapped http.HandlerFunc) {
f := func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
h.ServeHTTP(w, r)
}
return http.HandlerFunc(f)
}