1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refactor: make each router handler register middleware on its own

This commit is contained in:
Ferdinand Mütsch
2021-02-06 20:09:08 +01:00
parent 8fed606e9b
commit d1dc73b5e6
10 changed files with 74 additions and 32 deletions

View File

@@ -32,6 +32,7 @@ func NewBadgeHandler(summaryService services.ISummaryService, userService servic
}
func (h *BadgeHandler) RegisterRoutes(router *mux.Router) {
// no auth middleware here, handler itself resolves the user
r := router.PathPrefix("/shields/v1/{user}").Subrouter()
r.Methods(http.MethodGet).HandlerFunc(h.Get)
}