Currently, our angular code sends our HTTP requests to API_URL + whatever/endpoint/we/want. During development we set API_URL to be something on localhost and then for deployments we change it to be the fully qualified name of the host we are running it on. This is a pain and means the the code needs to be recompiled whenever we change hosts.
The solution is to use a relative URL so that angular will send HTTP requests to http://whatever-domain-name-it-was-accessed-via.com/whatever/endpoint/we/want
Currently, our angular code sends our HTTP requests to
API_URL + whatever/endpoint/we/want
. During development we setAPI_URL
to be something onlocalhost
and then for deployments we change it to be the fully qualified name of the host we are running it on. This is a pain and means the the code needs to be recompiled whenever we change hosts.The solution is to use a relative URL so that angular will send HTTP requests to
http://whatever-domain-name-it-was-accessed-via.com/whatever/endpoint/we/want
I think that this stack overflow post has a solution.