I would like to get the base URL of my web application from the Rack initialization code in mine config.ru. Sort of:
puts "Starting up on http://#{ENV['SERVER_NAME']}:#{ENV['SERVER_PORT']}/#{ENV['MOUNT_POINT']}..."
but I did not find anything like this accessible from outside the request handler. Obviously, I can do something like:
...
def get
puts "Got a request for #{ENV['rack.url_scheme']}://#{ENV['HTTP_HOST']}#{ENV['REQUEST_PATH']}"
...
because the request is defined at this point. But at the beginning of my configuration file, none of these variables are defined.
Is there a Rack way I can use to access this information? Is this one of those cases when these things are not finalized until the start of the Rack? I seem to remember that other structures have a way to pass proc to a method that will execute it as soon as the environment is "ready." Does the rack have something like that?