From 582c8c99ec6322c71f5e68424bab57c884bbc537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Delattre?= Date: Thu, 17 Nov 2016 12:04:26 +0100 Subject: [PATCH] Enable gzip compression on the server side --- src/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.go b/src/main.go index 71c76a6..413482e 100644 --- a/src/main.go +++ b/src/main.go @@ -13,6 +13,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/jmoiron/sqlx" _ "github.com/lib/pq" + "github.com/phyber/negroni-gzip/gzip" "github.com/urfave/negroni" ) @@ -78,6 +79,7 @@ func main() { n := negroni.Classic() n.Use(authMiddleware) n.Use(negroni.NewStatic(http.Dir(cf.PublicDir))) + n.Use(gzip.Gzip(gzip.DefaultCompression)) n.UseHandler(env.Router) n.Run(":" + cf.Port) }