mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Added the ability to set RACK_ENV when Puma is called from a Rack app and not through the CLI
This commit is contained in:
parent
54e9173965
commit
5c6facdec3
1 changed files with 5 additions and 0 deletions
|
@ -18,11 +18,16 @@ module Rack
|
|||
app = Rack::CommonLogger.new(app, STDOUT)
|
||||
end
|
||||
|
||||
if options[:environment]
|
||||
ENV['RACK_ENV'] = options[:environment].to_s
|
||||
end
|
||||
|
||||
server = ::Puma::Server.new(app)
|
||||
min, max = options[:Threads].split(':', 2)
|
||||
|
||||
puts "Puma #{::Puma::Const::PUMA_VERSION} starting..."
|
||||
puts "* Min threads: #{min}, max threads: #{max}"
|
||||
puts "* Environment: #{ENV['RACK_ENV']}"
|
||||
puts "* Listening on tcp://#{options[:Host]}:#{options[:Port]}"
|
||||
|
||||
server.add_tcp_listener options[:Host], options[:Port]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue