vendredi 4 décembre 2015

EmberJS, How to manage different "config variables" for different "environments"

There are several of questions under the emberjs tag that talk about how to manage different environments but all of them are only applying for very concrete scenarios.

I'm looking for a general solution of how to set different config variables for different environments.

Let's say of example I have one API URL for my develoment environment and another API URL for my production environment.

production_api_url = "http://ift.tt/1NvX6bt
development_api_url = "http://ift.tt/1m1i2RZ

And in my adapter I would like to use the appropriate API URL:

import ActiveModelAdapter from 'active-model-adapter';

export default ActiveModelAdapter.extend({
  namespace: 'api',
  host: [[API_URL]]
});




Aucun commentaire:

Enregistrer un commentaire