shard-kemal/docs/middlewares.md

15 lines
278 B
Markdown
Raw Normal View History

2015-12-16 18:32:01 +00:00
# Middlewares
You can create your own middlewares by inheriting from ```HTTP::Handler```
```crystal
class CustomHandler < HTTP::Handler
def call(request)
puts "Doing some custom stuff here"
call_next request
end
end
Kemal.config.add_handler CustomHandler.new
```