UMM-CSci-3601-S17 / digital-display-garden-iteration-2-grimaldi

digital-display-garden-iteration-2-grimaldi created by GitHub Classroom
MIT License
0 stars 0 forks source link

Make Angular send HTTP requests to a relative url #16

Open lverns opened 7 years ago

lverns commented 7 years ago

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

I think that this stack overflow post has a solution.

lverns commented 7 years ago

Actually, this stack overflow post looks even better.