2

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.

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

2 Answers 2

1

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.

1
  • Use case is to populate a callback URL which I sent to Salesforce during authentication.
    – Matt Lacey
    Commented Feb 20, 2014 at 2:46
1

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.

1
  • Caps come naturally to me for such things thanks to the C pre-processor!
    – Matt Lacey
    Commented Feb 20, 2014 at 2:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .