Add host to config

This commit is contained in:
Alex Ling 2021-03-03 17:35:39 +00:00
parent 6fa575cf4f
commit bf3900f9a2
2 changed files with 2 additions and 3 deletions

View File

@ -5,6 +5,7 @@ class Config
@[YAML::Field(ignore: true)]
property path : String = ""
property host : String = "0.0.0.0"
property port : Int32 = 9000
property base_url : String = "/"
property session_secret : String = "mango-session-secret"

View File

@ -49,9 +49,7 @@ class Server
{% if flag?(:release) %}
Kemal.config.env = "production"
{% end %}
unless Config.current.auth_proxy_header_name.empty?
Kemal.config.host_binding = "127.0.0.1"
end
Kemal.config.host_binding = Config.current.host
Kemal.config.port = Config.current.port
Kemal.run
end