Example #1
0
func selectRoute(m *macaron.Macaron, method string, h macaron.Handler) {
	switch method {
	case "GET":
		m.Get("/", h)
	case "PATCH":
		m.Patch("/", h)
	case "POST":
		m.Post("/", h)
	case "PUT":
		m.Put("/", h)
	case "DELETE":
		m.Delete("/", h)
	case "OPTIONS":
		m.Options("/", h)
	case "HEAD":
		m.Head("/", h)
	default:
		panic("bad method")
	}
}