mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Added return_with macro to break response in the middle of the block.
This commit is contained in:
parent
7b1bc43a41
commit
8110788a41
3 changed files with 41 additions and 0 deletions
|
@ -15,6 +15,12 @@ macro render(filename, *args)
|
|||
Kilt.render({{filename}}, {{*args}})
|
||||
end
|
||||
|
||||
macro return_with(env, status_code = 200, response = "")
|
||||
{{env}}.response.status_code = {{status_code}}
|
||||
{{env}}.response.print {{response}}
|
||||
next
|
||||
end
|
||||
|
||||
def add_handler(handler)
|
||||
Kemal.config.add_handler handler
|
||||
end
|
||||
|
@ -46,6 +52,7 @@ def logger(logger)
|
|||
Kemal.config.add_handler logger
|
||||
end
|
||||
|
||||
|
||||
def serve_static(status)
|
||||
Kemal.config.serve_static = status
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue