Skip to content

Commit

Permalink
support to register mux auto
Browse files Browse the repository at this point in the history
  • Loading branch information
zc2638 committed Feb 24, 2021
1 parent f26adb7 commit edaca95
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions swagger/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ func (a *API) RegisterMux(router RouteInterface, url string) {
}

func (a *API) RegisterMuxWithData(router RouteInterface, enableCors bool) {
for p, endpoints := range a.Paths {
router.Handle(p, endpoints)
}
const url = "/swagger-ui/json"
router.Handle(url, a.Handler(enableCors))
a.registerMux(router, url, true)
Expand Down

0 comments on commit edaca95

Please sign in to comment.