Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to discover the *external* hostname from within a heroku cedar application

Tags:

heroku

cedar

I am deploying a RubyOnRails 3.1 app to heroku cedar stack. From within the app I would like to auto discover the host name (i.e. appname.herokuapp.com). I have multiple deployments of the same app on heroku - some for development, some for staging and some for production. It would be nice to be able to check an environment variable or make some call to find out my app host name from within the app.

like image 364
bradgonesurfing Avatar asked Sep 21 '11 08:09

bradgonesurfing


1 Answers

does

request.host

give you want you want?

like image 55
John Beynon Avatar answered Oct 20 '22 00:10

John Beynon