require "../handler" require "../views/html/test/auth" class Guff::Handlers::TestAuthHandler < Guff::Handler PATH_RE = %r{^/test/auth/?$} def call(context : HTTP::Server::Context) if PATH_RE.match(context.request.path.not_nil!) case context.request.method when "GET", "HEAD" draw_page(context) else raise "unknown method" end else call_next(context) end end private def draw_page(context) TestAuthHTMLView.run(@models, context) end end