So I know how to use Heroku config variables to store environment-specific values, such as database URLs and the like, but are there any generic default config variables?

Specifically I'm wondering if there's one for the app domain, or whether I just need to create one myself for each environment in which the app is deployed.

  • Something like that is usually apart of the web framework. If you are using Ruby and Sinatra this would be request.host. – Phil Rymek Feb 20 '14 at 1:47

The current app domain is not exposed as a config var in running dynos. What's your use case for having domains? If it's to generate urls in a web app, consider just using relative urls, or grab the domain from the current request.

This Stack Overflow questions has some debate on how to find what environment is available by default.

| improve this answer | |
  • Use case is to populate a callback URL which I sent to Salesforce during authentication. – Matt Lacey Feb 20 '14 at 2:46

I think ruby apps have a few config vars by default (rack env, rails env, etc.) but you are on your own to add what you need. Just remember that most of the time they are entered in all caps.

| improve this answer | |
  • Caps come naturally to me for such things thanks to the C pre-processor! – Matt Lacey Feb 20 '14 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.