diff --git a/src/kemal/handler.cr b/src/kemal/handler.cr index 2855a70..a28e21b 100644 --- a/src/kemal/handler.cr +++ b/src/kemal/handler.cr @@ -1,7 +1,9 @@ require "http/server" require "uri" -# Handles the routes +# Kemal::Handler is the main handler which handles all the HTTP requests. Routing, parsing, rendering e.g +# are done in this handler. + class Kemal::Handler < HTTP::Handler INSTANCE = new diff --git a/src/kemal/websocket_handler.cr b/src/kemal/websocket_handler.cr index e5e35ae..b9ba544 100644 --- a/src/kemal/websocket_handler.cr +++ b/src/kemal/websocket_handler.cr @@ -1,3 +1,6 @@ +# Kemal::WebsocketHandler is used for each define WebSocket route. +# For each WebSocket route a new handler is created and registered to global handlers. + class Kemal::WebsocketHandler < HTTP::WebSocketHandler def initialize(@path, &@proc : WebSocketSession ->) Kemal.config.add_ws_handler self