mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Add extra_options from CLI
This commit is contained in:
commit
20a174b66e
3 changed files with 20 additions and 1 deletions
|
@ -34,6 +34,7 @@ module Kemal
|
|||
puts opts
|
||||
exit 0
|
||||
end
|
||||
@config.extra_options.try &.call(opts)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ module Kemal
|
|||
@server : HTTP::Server?
|
||||
|
||||
property host_binding, ssl, port, env, public_folder, logging,
|
||||
always_rescue, serve_static, server
|
||||
always_rescue, serve_static, server, extra_options
|
||||
|
||||
def initialize
|
||||
@host_binding = "0.0.0.0"
|
||||
|
@ -68,6 +68,9 @@ module Kemal
|
|||
HANDLERS.insert(0, @logger.not_nil!)
|
||||
end
|
||||
|
||||
def extra_options(&@extra_options : OptionParser ->)
|
||||
end
|
||||
|
||||
private def setup_error_handler
|
||||
if @always_rescue
|
||||
@error_handler ||= Kemal::CommonExceptionHandler.new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue