From 7c3a338748532a40abd7dfbd03e69c968b4e9e45 Mon Sep 17 00:00:00 2001 From: Adphi Date: Mon, 5 Sep 2022 11:32:24 +0200 Subject: [PATCH] react: export REACT_ENDPOINT env var, recovery interceptor: remove panicing client handlers Signed-off-by: Adphi --- interceptors/recovery/interceptors.go | 8 -------- react/ui.go | 6 +++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/interceptors/recovery/interceptors.go b/interceptors/recovery/interceptors.go index 5e4f38b..776b1ed 100644 --- a/interceptors/recovery/interceptors.go +++ b/interceptors/recovery/interceptors.go @@ -22,11 +22,3 @@ func (i *recovery) UnaryServerInterceptor() grpc.UnaryServerInterceptor { func (i *recovery) StreamServerInterceptor() grpc.StreamServerInterceptor { return grpc_recovery.StreamServerInterceptor(i.opts...) } - -func (i *recovery) UnaryClientInterceptor() grpc.UnaryClientInterceptor { - panic("not implemented") -} - -func (i *recovery) StreamClientInterceptor() grpc.StreamClientInterceptor { - panic("not implemented") -} diff --git a/react/ui.go b/react/ui.go index eaaaf9d..b3d56a8 100644 --- a/react/ui.go +++ b/react/ui.go @@ -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)