func selectRoute(r martini.Router, method string, h martini.Handler) { switch method { case "GET": r.Get("/", h) case "PATCH": r.Patch("/", h) case "POST": r.Post("/", h) case "PUT": r.Put("/", h) case "DELETE": r.Delete("/", h) case "OPTIONS": r.Options("/", h) case "HEAD": r.Head("/", h) default: panic("bad method") } }