Does Ember.js have a concept of environment, like for example Rails has (development/testing/production)? For example, I may want to log bunch of data into the console in development, but not in production. Any way to do this?
To avoid the XY problem, I'll explain my actual use case (which is the opposite of the one mentioned): I want to show a certain warning when the app is in production, but not show it in development. The warning should be shown if the app is not running over HTTPS. But, because development usually happens on local machine with HTTPS disabled, it would be quite annoying for the developer to have it shown to him/her all the time. So I want disable the warning in development.
There's no concept of environment on Ember, but you can delegate that responsibility to your server environment(express,rails, whatever your are using) you can set a JS variable, a cookie, localStorage value, whatever you want.
Edit: Also, as you are probably testing on a local environment, you could check for the domain in the URL e.g localhost, 0.0.0.0, etc,
for this you can use window.location.host
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