mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Move server from local scope to config
This commit is contained in:
parent
0eb7638b1b
commit
b32099e13b
2 changed files with 8 additions and 6 deletions
|
@ -8,12 +8,12 @@ module Kemal
|
|||
config.setup
|
||||
config.add_handler Kemal::RouteHandler::INSTANCE
|
||||
|
||||
server = HTTP::Server.new(config.host_binding.not_nil!, config.port, config.handlers)
|
||||
server.ssl = config.ssl
|
||||
config.server = HTTP::Server.new(config.host_binding.not_nil!, config.port, config.handlers)
|
||||
config.server.ssl = config.ssl
|
||||
|
||||
Signal::INT.trap {
|
||||
config.logger.write "Kemal is going to take a rest!\n"
|
||||
server.close
|
||||
config.server.close
|
||||
exit
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,6 @@ module Kemal
|
|||
end
|
||||
|
||||
config.logger.write "[#{config.env}] Kemal is ready to lead at #{config.scheme}://#{config.host_binding}:#{config.port}\n"
|
||||
server.listen
|
||||
config.server.listen
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue