July 2016
Intermediate to advanced
150 pages
4h 24m
English
When you ran the bin/rails server command, Puma started up with a nice set of defaults for development mode. But in production, you’ll want a more explicit configuration suited for your production deployment platform. In this section, you’ll create that platform and get Twitalytics ready for it.
To configure Puma, create a config/puma.rb file, open it in an editor, and put the following code in it:
| | port ENV['PORT'] || 3000 |
| | environment ENV['RACK_ENV'] || 'development' |
| | threads (ENV["MIN_PUMA_THREADS"] || 0), (ENV["MAX_PUMA_THREADS"] || 16) |
| | preload_app! |
This sets the port, environment, and thread pool size based on environment variables. The defaults are intended ...
Read now
Unlock full access