diff options
-rw-r--r-- | src/guff.cr | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/guff.cr b/src/guff.cr index 64c3b0e..9b5b952 100644 --- a/src/guff.cr +++ b/src/guff.cr @@ -2145,6 +2145,17 @@ module Guff abstract def authenticated_call(context : HTTP::Server::Context) end + class StubHandler < Handler + def call(context : HTTP::Server::Context) + STDERR.puts "%s %s" % [ + context.request.method, + context.request.path.not_nil! + ] + + call_next(context) + end + end + class SessionHandler < Handler def call(context : HTTP::Server::Context) # clear session @@ -2596,6 +2607,9 @@ module Guff HANDLERS = [{ :dev => true, + :id => :stub, + }, { + :dev => true, :id => :error, }, { :dev => false, @@ -2648,6 +2662,8 @@ module Guff context : Context ) : HTTP::Handler case handler_id + when :stub + StubHandler.new(context) when :error HTTP::ErrorHandler.new when :log |