react: export REACT_ENDPOINT env var, recovery interceptor: remove panicing client handlers

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2022-09-05 11:32:24 +02:00
parent d5210f8db5
commit 7c3a338748
2 changed files with 5 additions and 9 deletions

View File

@ -24,8 +24,12 @@ import (
"strings"
)
const (
EndpointEnv = "REACT_ENDPOINT"
)
func NewHandler(dir embed.FS, subpath string) (http.Handler, error) {
if e := os.Getenv("REACT_ENDPOINT"); e != "" {
if e := os.Getenv(EndpointEnv); e != "" {
return newProxy(e)
}
return newStatic(dir, subpath)