I have issue with my app when I use Angular to consuming REST API request
The Web Service URLs store in the Angular service or controller js file so if I have Login web service to check usename and password like:
http://mylocal.com/api/service.json?api_user=Username&api_key=Password
The end users or developers can get this url and build a software to try finding the username and password, so how to hide the web services urls in angular js if that possible?
Example:
$scope.submit = function(request) {
$scope.contactUsSuccess = false;
$http.post('/_/contactUs' +
"?firstName=" + encodeURIComponent(request.first) +
"&lastName=" + encodeURIComponent(request.last) +
"&email=" + encodeURIComponent(request.email) +
"&phone=" + encodeURIComponent(request.phone) +
"&company=" + encodeURIComponent(request.company) +
"&message=" + encodeURIComponent(request.message)
) // Contact us
.success(function(reply){
console.log(reply);
$scope.contactUsSuccess = true;
$scope.contactUs = "";
})
.error(function(){
alert('There seemed to be a problem with your submission. Please refresh the page and try again.')
});
};
You can get the contact url web service and use it, so how can i solve this issue?