From 0724e07c22513790fbeefeca3bf8e1a8407d44b2 Mon Sep 17 00:00:00 2001 From: sdogruyol Date: Sat, 13 May 2017 18:39:11 -0700 Subject: [PATCH] Make Route a Struct --- CHANGELOG.md | 9 +++++++++ src/kemal/route.cr | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34b3b67..4818234 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# Next + +- Make `Route` a `Struct`. +- Handlers are now completely customizable and you can specify your own handlers. + +```ruby +Kemal.config.handlers = [Kemal::InitHandler.new, YourHandler.new, Kemal::RouteHandler::INSTANCE] +``` + # 0.19.0 (09-05-2017) - Return no body for head route fixes #323. (thanks @crisward) diff --git a/src/kemal/route.cr b/src/kemal/route.cr index 8703f0d..1117548 100644 --- a/src/kemal/route.cr +++ b/src/kemal/route.cr @@ -2,7 +2,7 @@ module Kemal # Route is the main building block of Kemal. # It takes 3 parameters: Method, path and a block to specify # what action to be done if the route is matched. - class Route + struct Route getter method, path, handler @handler : HTTP::Server::Context -> String @method : String