dsp_099
dsp_099

Reputation: 6121

How does thin magically "take over" when included in the gemfile/required in the app?

I gem "thin" and require 'thin' are added to any (seems like) Rack app, it will automatically be chosen when the app is launched via rackup, instead of WEBrick.

How does rackup know to use thin? What if I use unicorn or Puma or something else?

Upvotes: 3

Views: 47

Answers (1)

Myst
Myst

Reputation: 19221

Rack's source code states has three default servers in the following order: Thin, Puma and WEBrick.

Rack will attempt to 'mount' these three servers unless the PHP_FCGI_CHILDREN or RACK_HANDLER environment variables are set.

This behavior might change in the future, but for now only thin and puma will be recognized automatically when their gems are included.

Upvotes: 1

Related Questions