mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
v0.6.0
This commit is contained in:
parent
c21567fe17
commit
7ad319c70d
5 changed files with 15 additions and 6 deletions
|
@ -10,6 +10,9 @@ at_exit do
|
|||
opts.on("-e ", "--environment ", "environment") do |env|
|
||||
Kemal.config.env = env
|
||||
end
|
||||
opts.on("-b", "--bind", "host binding") do |host_binding|
|
||||
Kemal.config.host_binding = host_binding
|
||||
end
|
||||
end
|
||||
|
||||
config = Kemal.config
|
||||
|
@ -18,9 +21,9 @@ at_exit do
|
|||
config.add_handler Kemal::StaticFileHandler.new(config.public_folder)
|
||||
config.add_handler Kemal::Handler::INSTANCE
|
||||
|
||||
server = HTTP::Server.new("0.0.0.0", config.port, config.handlers)
|
||||
server = HTTP::Server.new(config.host_binding.not_nil!.to_slice, config.port, config.handlers)
|
||||
server.ssl = config.ssl
|
||||
logger.write "[#{config.env}] Kemal is ready to lead at #{config.scheme}://0.0.0.0:#{config.port}\n"
|
||||
logger.write "[#{config.env}] Kemal is ready to lead at #{config.scheme}://#{config.host_binding}:#{config.port}\n"
|
||||
|
||||
Signal::INT.trap {
|
||||
logger.write "Kemal is going to take a rest!\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue