ruby - Can a Sinatra or Rack application find out if it is running with Apache or Thin? -
i trying silly automatic configuration of sinatra application allow use different sub uri depending whether run apache , passenger, or thin web server.
so question is: possible find out inside sinatra application web server runs it?
you can't (as far know) see if it's running on apache, can check if it's running on passenger:
if defined?(phusionpassenger) # running passenger! end
you should able same thin:
if defined?(thin) # running thin! end
Comments
Post a Comment