1
0
Fork 0
mirror of https://github.com/Luzifer/password.git synced 2024-12-20 12:51:17 +00:00

Enable gzip compression on assets

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-12-30 13:49:23 +01:00
parent 95e47e193f
commit 859535e7b8
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -11,6 +11,7 @@ import (
"github.com/gorilla/mux"
"github.com/spf13/cobra"
http_helper "github.com/Luzifer/go_helpers/http"
pwd "github.com/Luzifer/password/lib"
)
@ -29,7 +30,7 @@ func getCmdServe() *cobra.Command {
func actionCmdServe(cmd *cobra.Command, args []string) {
r := mux.NewRouter()
r.HandleFunc("/", handleFrontend).Methods("GET")
r.PathPrefix("/assets").HandlerFunc(handleAssets).Methods("GET")
r.PathPrefix("/assets").HandlerFunc(http_helper.GzipFunc(handleAssets)).Methods("GET")
r.HandleFunc("/v1/getPassword", handleAPIGetPasswordv1).Methods("GET")
http.Handle("/", r)