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:
Adphi 2022-09-05 11:32:24 +02:00
parent d5210f8db5
commit 7c3a338748
Signed by: adphi
GPG Key ID: 46BE4062DB2397FF
2 changed files with 5 additions and 9 deletions

View File

@ -22,11 +22,3 @@ func (i *recovery) UnaryServerInterceptor() grpc.UnaryServerInterceptor {
func (i *recovery) StreamServerInterceptor() grpc.StreamServerInterceptor { func (i *recovery) StreamServerInterceptor() grpc.StreamServerInterceptor {
return grpc_recovery.StreamServerInterceptor(i.opts...) return grpc_recovery.StreamServerInterceptor(i.opts...)
} }
func (i *recovery) UnaryClientInterceptor() grpc.UnaryClientInterceptor {
panic("not implemented")
}
func (i *recovery) StreamClientInterceptor() grpc.StreamClientInterceptor {
panic("not implemented")
}

View File

@ -24,8 +24,12 @@ import (
"strings" "strings"
) )
const (
EndpointEnv = "REACT_ENDPOINT"
)
func NewHandler(dir embed.FS, subpath string) (http.Handler, error) { 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 newProxy(e)
} }
return newStatic(dir, subpath) return newStatic(dir, subpath)