mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Add more documentation
This commit is contained in:
parent
b8e7ad2577
commit
20ef2b2927
2 changed files with 6 additions and 1 deletions
|
@ -1,7 +1,9 @@
|
||||||
require "http/server"
|
require "http/server"
|
||||||
require "uri"
|
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
|
class Kemal::Handler < HTTP::Handler
|
||||||
INSTANCE = new
|
INSTANCE = new
|
||||||
|
|
||||||
|
|
|
@ -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
|
class Kemal::WebsocketHandler < HTTP::WebSocketHandler
|
||||||
def initialize(@path, &@proc : WebSocketSession ->)
|
def initialize(@path, &@proc : WebSocketSession ->)
|
||||||
Kemal.config.add_ws_handler self
|
Kemal.config.add_ws_handler self
|
||||||
|
|
Loading…
Reference in a new issue