aboutsummaryrefslogtreecommitdiff
path: root/src/guff/handlers/test-handler.cr
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-03-08 17:03:44 -0500
committerPaul Duncan <pabs@pablotron.org>2016-03-08 17:03:44 -0500
commit8989c5b2601028f575211d7443c7c082b122079e (patch)
tree940844924c675039431f15fa9d1ef5b96481c950 /src/guff/handlers/test-handler.cr
parentb5d66c8d5ce941a6ee290128807f1f9e50aee4e9 (diff)
downloadold-guff-8989c5b2601028f575211d7443c7c082b122079e.tar.bz2
old-guff-8989c5b2601028f575211d7443c7c082b122079e.zip
refactor handlers
Diffstat (limited to 'src/guff/handlers/test-handler.cr')
-rw-r--r--src/guff/handlers/test-handler.cr18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/guff/handlers/test-handler.cr b/src/guff/handlers/test-handler.cr
index 3856400..f373630 100644
--- a/src/guff/handlers/test-handler.cr
+++ b/src/guff/handlers/test-handler.cr
@@ -1,14 +1,12 @@
-require "./handler"
+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
+class Guff::Handlers::TestHandler < Guff::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