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 = "" |       @key_file = "" | ||||||
|       @cert_file = "" |       @cert_file = "" | ||||||
|       @config = Kemal.config |       @config = Kemal.config | ||||||
|  |       read_env | ||||||
|       parse |       parse | ||||||
|       configure_ssl |       configure_ssl | ||||||
|     end |     end | ||||||
|  | @ -20,9 +21,6 @@ module Kemal | ||||||
|         opts.on("-p PORT", "--port PORT", "Port to listen for connections (defaults to 3000)") do |opt_port| |         opts.on("-p PORT", "--port PORT", "Port to listen for connections (defaults to 3000)") do |opt_port| | ||||||
|           @config.port = opt_port.to_i |           @config.port = opt_port.to_i | ||||||
|         end |         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 |         opts.on("-s", "--ssl", "Enables SSL") do | ||||||
|           @ssl_enabled = true |           @ssl_enabled = true | ||||||
|         end |         end | ||||||
|  | @ -49,5 +47,9 @@ module Kemal | ||||||
|         Kemal.config.ssl = ssl.context |         Kemal.config.ssl = ssl.context | ||||||
|       end |       end | ||||||
|     end |     end | ||||||
|  | 
 | ||||||
|  |     def read_env | ||||||
|  |       @config.env = ENV.fetch("KEMAL_ENV", "development") | ||||||
|  |     end | ||||||
|   end |   end | ||||||
| end | end | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue