Skip to content

Commit

Permalink
feat(endpoint): /docs redirect to /swagger-ui
Browse files Browse the repository at this point in the history
For people used to FastAPI :)
  • Loading branch information
kpetremann committed Jan 7, 2025
1 parent ba11720 commit a182aa7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/api/router/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func (m *Manager) ListenAndServe(ctx context.Context, address string, port int,
if handler, err := swaggerHandler(api); err != nil {
panic(fmt.Sprintf("failed to bootstrap Swagger UI: %s", err)) // this should never happen
} else {
mux.Handle("GET /docs", http.RedirectHandler("/swagger-ui", http.StatusMovedPermanently))
mux.Handle("GET /swagger-ui", handler)
mux.Handle("GET /swagger-ui/", handler)
}
Expand Down

0 comments on commit a182aa7

Please sign in to comment.