From a88b1e7a59bf97bfade33be99887a10947ac8944 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 10 May 2019 16:19:20 +0200 Subject: [PATCH] Add gzip compression for included assets Signed-off-by: Knut Ahlers --- main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 21dd884..5de9857 100644 --- a/main.go +++ b/main.go @@ -11,10 +11,11 @@ import ( "strings" "text/template" - http_helpers "github.com/Luzifer/go_helpers/http" - "github.com/Luzifer/rconfig" "github.com/gorilla/mux" log "github.com/sirupsen/logrus" + + http_helpers "github.com/Luzifer/go_helpers/http" + "github.com/Luzifer/rconfig" ) var ( @@ -55,7 +56,7 @@ func main() { r := mux.NewRouter() api.Register(r.PathPrefix("/api").Subrouter()) - r.PathPrefix("/").HandlerFunc(assetDelivery) + r.PathPrefix("/").HandlerFunc(http_helpers.GzipFunc(assetDelivery)) log.Fatalf("HTTP server quit: %s", http.ListenAndServe(cfg.Listen, http_helpers.NewHTTPLogHandler(r))) }