fix: handle nil DocsHandler and add DOCS env var

This commit is contained in:
Chris Rai
2026-01-31 01:51:04 -05:00
parent a03319f090
commit 5e2c13c57e
2 changed files with 6 additions and 1 deletions

View File

@@ -15,7 +15,9 @@ import (
func StartHTTP(ctx context.Context, port string) {
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("/secret_mobile", httphandlers.PanicHandler(handlers.InsecureSessionWebsocketHandler))