I'm developing single page application in javascript and consume data from RESTful web service. I host it on simple lighttpd web server. I want to have different url for consuming data by environment like development mode points to my local web service and production mode point to online webservice.
Asked
Active
Viewed 373 times
1 Answers
0
Route all XMLHttpRequest
through a wrapper. In this wrapper, initialize the environment that basically sets the base URL for all outgoing requests. Since you're using a RESTful design, I suppose the URIs are going to be the same for each environment, only the base path is going to change.

Anurag
- 140,337
- 36
- 221
- 257