How can I retreive the --proxy value within ember?

I would like to get this value in my ember services so that I can adjust the ajax URL’s myself. I don’t have a clue where I could find this value, it must be stored somewhere.

I think that’s not a good way. But you can access Config https://guides.emberjs.com/v2.10.0/configuring-ember/configuring-your-app/#toc-toggle just importing it. Try other solutions before it. ( proxy pass )

@heatbr Config doesn’t contain the value of --proxy.

Anyone see another possibility?

You can get it in the file config/environment.js.

const proxy = (process.argv.indexOf('--proxy') != -1) ? process.argv[process.argv.indexOf('--proxy') + 1] : '';
1 Like