fix: handle nil DocsHandler and add DOCS env var
This commit is contained in:
@@ -38,3 +38,6 @@ VAULT_URL=http://vault.vault.svc.cluster.local:8200/v1
|
|||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
LOG_LEVEL=info
|
LOG_LEVEL=info
|
||||||
|
|
||||||
|
# Docs
|
||||||
|
DOCS=/docs
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ import (
|
|||||||
func StartHTTP(ctx context.Context, port string) {
|
func StartHTTP(ctx context.Context, port string) {
|
||||||
mux := httptrace.NewServeMux()
|
mux := httptrace.NewServeMux()
|
||||||
|
|
||||||
mux.Handle("/docs/", http.StripPrefix("/docs", handlers.DocsHandler()))
|
if docsHandler := handlers.DocsHandler(); docsHandler != nil {
|
||||||
|
mux.Handle("/docs/", http.StripPrefix("/docs", docsHandler))
|
||||||
|
}
|
||||||
|
|
||||||
mux.HandleFunc("/session", httphandlers.PanicHandler(handlers.SecureSessionWebsocketHandler))
|
mux.HandleFunc("/session", httphandlers.PanicHandler(handlers.SecureSessionWebsocketHandler))
|
||||||
mux.HandleFunc("/secret_mobile", httphandlers.PanicHandler(handlers.InsecureSessionWebsocketHandler))
|
mux.HandleFunc("/secret_mobile", httphandlers.PanicHandler(handlers.InsecureSessionWebsocketHandler))
|
||||||
|
|||||||
Reference in New Issue
Block a user