Skip to content

Commit

Permalink
HTTP::Handler is not a class anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
sdogruyol committed Dec 24, 2016
1 parent ac8ec0a commit 81a7022
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/kemal/base_log_handler.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Kemal
# All loggers must inherit from `Kemal::BaseLogHandler`.
abstract class Kemal::BaseLogHandler < HTTP::Handler
abstract class Kemal::BaseLogHandler
include HTTP::Handler

abstract def call(context)
abstract def write(message)
end
Expand Down
3 changes: 2 additions & 1 deletion src/kemal/common_exception_handler.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Kemal
# Kemal::CommonExceptionHandler handles all the exceptions including 404, custom errors and 500.
class CommonExceptionHandler < HTTP::Handler
class CommonExceptionHandler
include HTTP::Handler
INSTANCE = new

def call(context)
Expand Down
3 changes: 2 additions & 1 deletion src/kemal/filter_handler.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module Kemal
# Kemal::FilterHandler handle all code that should be evaluated before and after
# every request
class FilterHandler < HTTP::Handler
class FilterHandler
include HTTP::Handler
INSTANCE = new

# This middleware is lazily instantiated and added to the handlers as soon as a call to `after_X` or `before_X` is made.
Expand Down
3 changes: 2 additions & 1 deletion src/kemal/handler.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class Kemal::Handler < HTTP::Handler
class Kemal::Handler
include HTTP::Handler
@@only_routes_tree = Radix::Tree(String).new
@@exclude_routes_tree = Radix::Tree(String).new

Expand Down
3 changes: 2 additions & 1 deletion src/kemal/init_handler.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module Kemal
# Kemal::InitHandler is the first handler thus initializes the context with default values such as
# Content-Type, X-Powered-By.
class InitHandler < HTTP::Handler
class InitHandler
include HTTP::Handler
INSTANCE = new

def call(context)
Expand Down
3 changes: 2 additions & 1 deletion src/kemal/route_handler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ require "radix"
module Kemal
# Kemal::RouteHandler is the main handler which handles all the HTTP requests. Routing, parsing, rendering e.g
# are done in this handler.
class RouteHandler < HTTP::Handler
class RouteHandler
include HTTP::Handler
INSTANCE = new

property tree
Expand Down

0 comments on commit 81a7022

Please sign in to comment.