Skip to content

Commit 7c373ca

Browse files
committed
feat(endpoint): /docs redirect to /swagger-ui
For people used to FastAPI :)
1 parent b20ff74 commit 7c373ca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

internal/api/router/manager.go

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func (m *Manager) ListenAndServe(ctx context.Context, address string, port int,
149149
if handler, err := swaggerHandler(api); err != nil {
150150
panic(fmt.Sprintf("failed to bootstrap Swagger UI: %s", err)) // this should never happen
151151
} else {
152+
mux.Handle("GET /docs", http.RedirectHandler("/swagger-ui", http.StatusMovedPermanently))
152153
mux.Handle("GET /swagger-ui", handler)
153154
mux.Handle("GET /swagger-ui/", handler)
154155
}

0 commit comments

Comments
 (0)