From d9fb51f2f99a5cc5b1939cbfa82cc783031cdd38 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Fri, 28 Jan 2022 05:20:05 +0100 Subject: [PATCH] Reuse static server for multiple requests (#2258) --- pkg/api/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/api/server.go b/pkg/api/server.go index e92c3824f..625392ff4 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -184,6 +184,7 @@ func Start(uiBox embed.FS, loginUIBox embed.FS) { } customUILocation := c.GetCustomUILocation() + static := statigz.FileServer(uiBox) // Serve the web app r.HandleFunc("/*", func(w http.ResponseWriter, r *http.Request) { @@ -222,7 +223,7 @@ func Start(uiBox embed.FS, loginUIBox embed.FS) { } r.URL.Path = uiRootDir + r.URL.Path - statigz.FileServer(uiBox).ServeHTTP(w, r) + static.ServeHTTP(w, r) } })