oes anyone know why this doesn't work? the compress middleware i mean

func main() {
r := chi.NewRouter()

r.Use(middleware.Compress(5, "text/plain"))
//r.Use(middleware.Logger)

r.Get("/", index)

http.ListenAndServe(":3000", r)
}

func index(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
w.Write([]byte("hello"))
}
You already invited:

If you wanna answer this question please Login or Register