def redirect(path, options = {}, &endpoint)
      destination_path = @router.find(options)
      get(path).redirect(destination_path, options[:code] || 301).tap do |route|
        route.dest = Hanami::Routing::RedirectEndpoint.new(destination_path, route.dest)
      end
    end
def redirect(path, options = {}, &endpoint)
      destination_path = @router.find(options)
      get(path).redirect(destination_path, options[:code] || 301).tap do |route|
        route.dest = Hanami::Routing::RedirectEndpoint.new(destination_path, route.dest)
      end
    end
Defines an HTTP redirect

 @param path [String] the path that needs to be redirected
 @param options [Hash] the options to customize the redirect behavior
 @option options [Fixnum] the HTTP status to return (defaults to `301`)

 @return [Hanami::Routing::Route] the generated route.
   This may vary according to the `:route` option passed to the initializer

 @since 0.1.0

 @see Hanami::Router

 @example
   require 'hanami/router'

   Hanami::Router.new do
     redirect '/legacy',  to: '/new_endpoint'
     redirect '/legacy2', to: '/new_endpoint2', code: 302
   end

 @example
   require 'hanami/router'

   router = Hanami::Router.new
   router.redirect '/legacy',  to: '/new_endpoint'