Sha256: c8eb5f9666306d680940f04c53969cfeeb31728e56808e6abe9c9830ce2fb1e2
Contents?: true
Size: 644 Bytes
Versions: 5
Compression:
Stored size: 644 Bytes
Contents
# frozen_string_literal: true use Utopia::Redirection::Rewrite, "/" => "/welcome/index" use Utopia::Redirection::DirectoryIndex use Utopia::Redirection::Errors, 404 => '/error', 418 => '/teapot' use Utopia::Redirection::Moved, "/a", "/b" use Utopia::Redirection::Moved, "/hierarchy/", "/hierarchy", flatten: true use Utopia::Redirection::Moved, "/weird", "/status", status: 333 def error_handler(env) request = Rack::Request.new(env) if request.path_info == "/error" [200, {}, ["File not found :("]] elsif request.path_info == "/teapot" [418, {}, ["I'm a teapot!"]] else [404, {}, []] end end run self.method(:error_handler)
Version data entries
5 entries across 5 versions & 1 rubygems