I have ad restful server and a web server in another domain for serving asset files.
In past both of this servers was same and serves in one server. and now I try to change the relative URLs to Explicit one.
Ordinary solution is changing all used URLs like this:
$http.post(DATA_SERVER_DOMAIN+"/service/method" )
instead of
$http.post("/service/method" )
is there any solution to set fixed domain for all $http
or $resource
requests in angularJS (for example in $httpprovider)
I really suggest using the Restangular Library if you want functionality like this and a better coding experience.
It allows you to set different base urls for each service you create.
Reference.
While this may not be exactly what you're looking for at the moment, you'll be happy you took my advice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With