I need to do some initialization depending on the web server that is used to run the application. Is it possible to programmatically determine from a rail initializer?
Even if itβs not so clean, you can use
defined?(::Thin) defined?(::Unicorn) defined?(::Passanger)
etc. This will work for the three, and you should check if it works with others.
Here is a kind of hacker way to do this (add to config/application.rb ):
config/application.rb
module Rails class Server < ::Rack::Server alias_method :old_start, :start def start puts server.name # or set an ENV variable old_start end end end
You can check if the process is working or not using ps aux
ps aux | grep passenger ps aux | grep puma ps aux | grep unicorm
I just finished using https://www.builtwith.com , it gives all the necessary information.
Source: https://habr.com/ru/post/969756/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/969751/sharepoint-2013-mvc-5-provider-hosted-app-fails-to-authenticate-on-httppost-using-sharepointcontextfilter&usg=ALkJrhhv_3zITOJ5UqfakqI49opK_3V61gHow to access a second element that has the same class name in selenium using java - javaIndexing an array with string (C) - cHow to access the second element with the same class name in selenium - pythoniOS: complete download task when application is in background - iosUpload image / video to facebook asynchronously using php sdk 4 - asynchronousnotificationManager receives notification by identifier - androidWarning: filemtime (): stat failed for - htmlNMAKE: fatal error U1077: 'cd': return code '0x2' cl.exe - c ++change a git commit already clicked - gitAll Articles