// set up the admin Routes, and add in the Authenticator middleware if present func Routes(r *gin.RouterGroup) { // root level is list of admin models r.Handle("GET", "/", index) r.Handle("GET", "/:model/", list) r.Handle("POST", "/:model/", listUpdate) r.Handle("GET", "/:model/:pk", change) r.Handle("POST", "/:model/:pk", changeUpdate) }
func handle(g *gin.RouterGroup, m string, s string, h ...gin.HandlerFunc) { g.Handle(m, s, h...) }