I have a simple Rack application where part of its behaviour/configuration changes depending on the location(host and port) where it is mounted.
Rack exposes the current host and port in the Environment under SERVER_NAME
and SERVER_PORT
. But these are of course only passed along to the Rack app's call(env)
method when the first request is made.
Because part of the setup is dependent on the location, I want to read above setting in the initialize
of my Rack app's class. (How) can this be done?