Add GzipHandler
This commit is contained in:
parent
eb04fd0049
commit
9352ef7f12
3
main.go
3
main.go
@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/FreifunkBremen/respond-collector/models"
|
"github.com/FreifunkBremen/respond-collector/models"
|
||||||
"github.com/FreifunkBremen/respond-collector/respond"
|
"github.com/FreifunkBremen/respond-collector/respond"
|
||||||
"github.com/FreifunkBremen/respond-collector/websocketserver"
|
"github.com/FreifunkBremen/respond-collector/websocketserver"
|
||||||
|
"github.com/NYTimes/gziphandler"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -47,7 +48,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if config.Webserver.Enable {
|
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)
|
address := net.JoinHostPort(config.Webserver.Address, config.Webserver.Port)
|
||||||
log.Println("starting webserver on", address)
|
log.Println("starting webserver on", address)
|
||||||
|
Loading…
Reference in New Issue
Block a user