mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
15 lines
278 B
Markdown
15 lines
278 B
Markdown
|
# 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
|
||
|
```
|