Environment-based host in Ember CLI app

后端 未结 2 1102
一整个雨季
一整个雨季 2021-02-19 22:35

I\'m trying to configure the adapter in my Ember CLI app to use a different host based on the environment. In dev, I want it to be the default current host (letting me customize

2条回答
  •  北荒
    北荒 (楼主)
    2021-02-19 22:46

    This seems to work

    // adapters/application.js
    import DS from "ember-data";
    
    export default DS.ActiveModelAdapter.extend({
      host: window.MyAppENV.host
    });
    

    though I'm not sure if it's the best method.

提交回复
热议问题