title: How can I configure my front-end JavaScript application?
body: <p>I have a JavaScript application that needs to interact with many different service endpoints. E.g. the application makes calls to <code>api.mydomain.com</code> and <code>users.mydomain.com</code>. The user gets the front-end application by visiting <code>mydomain.com</code>. I would like to set up a test version of my services, meaning I will now have <code>users-test.mydomain.com</code>, <code>api-test.mydomain.com</code>, etc. The test version of the application will be located at <code>test.mydomain.com</code>.</p>
  
  <p>The JavaScript powering the normal and test versions will be identical, but all of the endpoints will be different. What is the best way to configure the front-end to allow this domain (test, production) specific switching? </p>