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:
parent
95e47e193f
commit
859535e7b8
1 changed files with 2 additions and 1 deletions
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
http_helper "github.com/Luzifer/go_helpers/http"
|
||||||
pwd "github.com/Luzifer/password/lib"
|
pwd "github.com/Luzifer/password/lib"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ func getCmdServe() *cobra.Command {
|
||||||
func actionCmdServe(cmd *cobra.Command, args []string) {
|
func actionCmdServe(cmd *cobra.Command, args []string) {
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.HandleFunc("/", handleFrontend).Methods("GET")
|
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")
|
r.HandleFunc("/v1/getPassword", handleAPIGetPasswordv1).Methods("GET")
|
||||||
|
|
||||||
http.Handle("/", r)
|
http.Handle("/", r)
|
||||||
|
|
Loading…
Reference in a new issue