I have written REST API using spring mvc which is hosted on one domain and Front end is written using HTML and angular JS which is hosted on another domain.Now I want to call REST API from another domain on which Frond UI is placed so how can I call REST API using relative URI instead of absolute URI?
For e.g.Instaed of
webbrokerModule.factory('CustomerContact', [ '$resource', function($resource) {
return $resource('http://localhost:24000/webbroker/customercontact/:brokerid', {
brokerid : '@brokerid'
}, {
get : {
method : 'GET'
}
});
} ]);
I want to call it as
webbrokerModule.factory('CustomerContact', [ '$resource', function($resource) {
return $resource('/webbroker/customercontact/:brokerid', {
brokerid : '@brokerid'
}, {
get : {
method : 'GET'
}
});
} ]);
I do not want to mention IP address and PORT.