diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-03-05 23:08:26 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-03-05 23:08:26 -0500 |
commit | 1e7f2784a13492da87c8351171e7355dd068bd79 (patch) | |
tree | fdd6b3e2f7c3b08ed6e971b7f00128c06eb29025 /src/guff/test-handler.cr | |
parent | 0c003fc2985c5ce0a2d04026d63ab7265ce9af94 (diff) | |
download | old-guff-1e7f2784a13492da87c8351171e7355dd068bd79.tar.bz2 old-guff-1e7f2784a13492da87c8351171e7355dd068bd79.zip |
add api and test handlers, refactor config
Diffstat (limited to 'src/guff/test-handler.cr')
-rw-r--r-- | src/guff/test-handler.cr | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/guff/test-handler.cr b/src/guff/test-handler.cr new file mode 100644 index 0000000..3856400 --- /dev/null +++ b/src/guff/test-handler.cr @@ -0,0 +1,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 |