This may be a dumb question, but how to get access to process.env
vars inside of my ember app? I tried to access process.env
in one of my controllers, but I received an error that process was not defined.
You generally don't have access to process.env since this is node.js global variable and ember.js generally runs in the browser which will not have process.env
However, you can use process.env during the build process which will produce ember app with the env variables build-in which you can access in another way.
I'm not sure what tooling you are using but here is how it works in Ember CLI Deploy:
http://ember-cli-deploy.com/docs/v1.0.x/using-env-for-secrets/
And here is an example with webpack:
https://webpack.js.org/guides/environment-variables/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With