From e4c342e5995df16b5a0b0b5a0c3b542b75f821dc Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Fri, 15 Jul 2016 15:54:25 -0400 Subject: add StubHandler (bad name) --- src/guff.cr | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/guff.cr') 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 @@ -2595,6 +2606,9 @@ module Guff end HANDLERS = [{ + :dev => true, + :id => :stub, + }, { :dev => true, :id => :error, }, { @@ -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 -- cgit v1.2.3