mirror of
https://github.com/Luzifer/ots.git
synced 2024-10-01 01:06:09 -04:00
Add gzip compression for included assets
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c458687f26
commit
a88b1e7a59
7
main.go
7
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)))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user