Enable gzip compression on the server side

This commit is contained in:
Grégoire Delattre 2016-11-17 12:04:26 +01:00
parent 06837a8776
commit 582c8c99ec

View File

@ -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)
}