mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	New option to set application name (#606)
This commit is contained in:
		
							parent
							
								
									3fee068636
								
							
						
					
					
						commit
						de5e022222
					
				
					 3 changed files with 12 additions and 4 deletions
				
			
		|  | @ -67,11 +67,11 @@ module Kemal | |||
| 
 | ||||
|   def self.display_startup_message(config, server) | ||||
|     addresses = server.addresses.join ", " { |address| "#{config.scheme}://#{address}" } | ||||
|     log "[#{config.env}] Kemal is ready to lead at #{addresses}" | ||||
|     log "[#{config.env}] #{config.app_name} is ready to lead at #{addresses}" | ||||
|   end | ||||
| 
 | ||||
|   def self.stop | ||||
|     raise "Kemal is already stopped." if !config.running | ||||
|     raise "#{Kemal.config.app_name} is already stopped." if !config.running | ||||
|     if server = config.server | ||||
|       server.close unless server.closed? | ||||
|       config.running = false | ||||
|  | @ -90,7 +90,7 @@ module Kemal | |||
| 
 | ||||
|   private def self.setup_trap_signal | ||||
|     Signal::INT.trap do | ||||
|       log "Kemal is going to take a rest!" if Kemal.config.shutdown_message | ||||
|       log "#{Kemal.config.app_name} is going to take a rest!" if Kemal.config.shutdown_message | ||||
|       Kemal.stop | ||||
|       exit | ||||
|     end | ||||
|  |  | |||
|  | @ -24,9 +24,10 @@ module Kemal | |||
|     property always_rescue, server : HTTP::Server?, extra_options, shutdown_message | ||||
|     property serve_static : (Bool | Hash(String, Bool)) | ||||
|     property static_headers : (HTTP::Server::Response, String, File::Info -> Void)? | ||||
|     property powered_by_header : Bool = true | ||||
|     property powered_by_header : Bool = true, app_name | ||||
| 
 | ||||
|     def initialize | ||||
|       @app_name = "Kemal" | ||||
|       @host_binding = "0.0.0.0" | ||||
|       @port = 3000 | ||||
|       @env = ENV["KEMAL_ENV"]? || "development" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue