1
0
mirror of https://github.com/Luzifer/password.git synced 2024-09-19 18:32:57 +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)