From 9352ef7f122bed6ec10f0843991e800c9c48f10b Mon Sep 17 00:00:00 2001 From: Julian Kornberger Date: Sun, 20 Mar 2016 19:40:03 +0100 Subject: [PATCH] Add GzipHandler --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 7a6cd76..884d1a8 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,7 @@ import ( "github.com/FreifunkBremen/respond-collector/models" "github.com/FreifunkBremen/respond-collector/respond" "github.com/FreifunkBremen/respond-collector/websocketserver" + "github.com/NYTimes/gziphandler" ) var ( @@ -47,7 +48,7 @@ func main() { } if config.Webserver.Enable { - http.Handle("/", http.FileServer(http.Dir(config.Webserver.Webroot))) + http.Handle("/", gziphandler.GzipHandler(http.FileServer(http.Dir(config.Webserver.Webroot)))) address := net.JoinHostPort(config.Webserver.Address, config.Webserver.Port) log.Println("starting webserver on", address)