mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Read env from KEMAL_ENV instead of -e. Fixes #168
This commit is contained in:
parent
19581d6e3e
commit
2c0dc7fa63
1 changed files with 5 additions and 3 deletions
|
@ -8,6 +8,7 @@ module Kemal
|
|||
@key_file = ""
|
||||
@cert_file = ""
|
||||
@config = Kemal.config
|
||||
read_env
|
||||
parse
|
||||
configure_ssl
|
||||
end
|
||||
|
@ -20,9 +21,6 @@ module Kemal
|
|||
opts.on("-p PORT", "--port PORT", "Port to listen for connections (defaults to 3000)") do |opt_port|
|
||||
@config.port = opt_port.to_i
|
||||
end
|
||||
opts.on("-e ENV", "--environment ENV", "Environment [development, production] (defaults to development). Set `production` to boost performance") do |env|
|
||||
@config.env = env
|
||||
end
|
||||
opts.on("-s", "--ssl", "Enables SSL") do
|
||||
@ssl_enabled = true
|
||||
end
|
||||
|
@ -49,5 +47,9 @@ module Kemal
|
|||
Kemal.config.ssl = ssl.context
|
||||
end
|
||||
end
|
||||
|
||||
def read_env
|
||||
@config.env = ENV.fetch("KEMAL_ENV", "development")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue