Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables? #552

Open
adambedford opened this issue Oct 11, 2017 · 3 comments
Open

Environment variables? #552

adambedford opened this issue Oct 11, 2017 · 3 comments

Comments

@adambedford
Copy link

Is it possible to access environment variables somehow within the Ember app, particularly environment.js?

@dmuneras
Copy link

dmuneras commented Oct 18, 2017

@adambedford Yes, you can access them in the environment.js. Every ENV variable is accessible in your environment.js.

Ex. You can access your RAILS env variables using the process env.

module.exports = function(environment) {
  ...
   // could be any of the env variables you set in your rails app 
  // when running inside the Rails process.
   var ENV = {
       randomEnvVariable: process.env.RAILS_ENV 
       ...
   }
  ...
   return ENV;
};

Best regards,
Daniel

@darylalexjohnson
Copy link

Docs do state that RAILS_ENV is removed in the production build.

@dmuneras
Copy link

Hey @darylalexjohnson,

But the rest of the ENV VARIABLES are available, don't they?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants