aboutsummaryrefslogtreecommitdiff
path: root/src/guff/test-handler.cr
blob: 3856400f19b175a1c84a3aa9a9181460c4378d47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require "./handler"

module Guff
  class TestHandler < Handler
    def call(context : HTTP::Server::Context)
      if ((context.request.path || "").match(/^\/test\//))
        context.response.content_type = "text/html"
        context.response.puts "test"
      else
        call_next(context)
      end
    end
  end
end