diff --git a/route/route.go b/route/route.go index 1c41b03af..fb337077a 100644 --- a/route/route.go +++ b/route/route.go @@ -75,6 +75,11 @@ func (r *Router) Get(path string, h http.HandlerFunc) { r.rtr.GET(r.prefix+path, handle(h)) } +// Options registers a new OPTIONS route. +func (r *Router) Options(path string, h http.HandlerFunc) { + r.rtr.OPTIONS(r.prefix+path, handle(h)) +} + // Del registers a new DELETE route. func (r *Router) Del(path string, h http.HandlerFunc) { r.rtr.DELETE(r.prefix+path, handle(h))