module HTTP::Handler
Overview
A handler is a class which includes HTTP::Handler
and implements the #call
method.
You can use a handler to intercept any incoming request and can modify the response.
These can be used for request throttling, ip-based whitelisting, adding custom headers e.g.
A custom handler
class CustomHandler
include HTTP::Handler
def call(context)
puts "Doing some stuff"
call_next(context)
end
end
Direct including types
- HTTP::CompressHandler
- HTTP::ErrorHandler
- HTTP::LogHandler
- HTTP::StaticFileHandler
- HTTP::WebSocketHandler
Defined in:
http/server/handler.crInstance Method Summary
- #call(context : HTTP::Server::Context)
- #call_next(context : HTTP::Server::Context)
- #next : Handler | Proc | Nil
- #next=(next : Handler | Proc | Nil)