This commit is contained in:
Serdar Dogruyol 2017-09-05 11:10:04 +03:00
parent faedeebee9
commit 1c069ab643
2 changed files with 1 additions and 2 deletions

View file

@ -14,7 +14,7 @@ FILTER_METHODS = %w(get post put patch delete options all)
end end
{% end %} {% end %}
def ws(path : String, &block : HTTP::WebSocket, HTTP::Server::Context -> Void) def ws(path : String, &block : HTTP::WebSocket, HTTP::Server::Context -> _)
raise Kemal::Exceptions::InvalidPathStartException.new("ws", path) unless Kemal::Utils.path_starts_with_slash?(path) raise Kemal::Exceptions::InvalidPathStartException.new("ws", path) unless Kemal::Utils.path_starts_with_slash?(path)
Kemal::WebSocketHandler.new path, &block Kemal::WebSocketHandler.new path, &block
end end

View file

@ -5,7 +5,6 @@ module Kemal
struct Route struct Route
getter method, path, handler getter method, path, handler
@handler : HTTP::Server::Context -> String @handler : HTTP::Server::Context -> String
@method : String
def initialize(@method : String, @path : String, &handler : HTTP::Server::Context -> _) def initialize(@method : String, @path : String, &handler : HTTP::Server::Context -> _)
@handler = ->(context : HTTP::Server::Context) do @handler = ->(context : HTTP::Server::Context) do