How to pass API keys in environment variables to Ember CLI using process.env?

前端 未结 4 1872
有刺的猬
有刺的猬 2020-12-13 14:34

How do I pass environment variables from bashrc to Ember CLI. I imagine a situation where you need stripe api keys or pusher api-keys and you have them in your environment v

4条回答
  •  半阙折子戏
    2020-12-13 15:23

    You can also set the variables on the ENV.APP object: they will be carried by the application instance.

    You can then reuse them inside initializer & so on.

    This way, you won't have to import config/environment into application's code, which seems a little weird to me.

提交回复
热议问题