I’m developing a modular Sinatra app. I use unicorn. The App needs some initial setup for db etc, where do I do that?
my config.ru:
require './main.rb'
disable :run #disable internal webserver
run App.new
my Procfile:
web: unicorn -p 8080 -c ./unicorn.rb
my unicorn.rb:
worker_processes 4
timeout 30
The setup happens somewhere in main.rb.
Ideally, outside of your application, as something that runs before unicorn is started.
You can potentially place the setup portion of
main.rbat the top ofunicorn.rb.