Check for KEMAL_ENV variable already in Config#initialize (#552)
This commit is contained in:
parent
15022c25b8
commit
740cb188a9
|
@ -8,7 +8,6 @@ module Kemal
|
|||
@key_file = ""
|
||||
@cert_file = ""
|
||||
@config = Kemal.config
|
||||
read_env
|
||||
if args
|
||||
parse args
|
||||
end
|
||||
|
@ -52,11 +51,5 @@ module Kemal
|
|||
end
|
||||
{% end %}
|
||||
end
|
||||
|
||||
private def read_env
|
||||
if kemal_env = ENV["KEMAL_ENV"]?
|
||||
@config.env = kemal_env
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ module Kemal
|
|||
def initialize
|
||||
@host_binding = "0.0.0.0"
|
||||
@port = 3000
|
||||
@env = "development"
|
||||
@env = ENV["KEMAL_ENV"]? || "development"
|
||||
@serve_static = {"dir_listing" => false, "gzip" => true}
|
||||
@public_folder = "./public"
|
||||
@logging = true
|
||||
|
|
Loading…
Reference in New Issue