kemal/docs/middlewares.md
2015-12-16 20:32:01 +02:00

278 B

Middlewares

You can create your own middlewares by inheriting from HTTP::Handler

class CustomHandler < HTTP::Handler
  def call(request)
    puts "Doing some custom stuff here"
    call_next request
  end
end

Kemal.config.add_handler CustomHandler.new