I am using $http.get with a relative url like this:
$http.get('/api/product')
.then(function (res) { });
The resultant call is:
GET http://localhost/api/product 404 (Not Found)
Now the problem is my site is running in IIS under a virtual directory, the structure is like this:
Sites
- Default Web Site
- Website (Virtual Directory)
- Services (Virtual Directory)
So the URL I actually want AngularJs to call is:
GET http://localhost/website/api/product
I have tried setting the BASE element like this:
<base href="Website/">
(And using http://localhost/website/)
But nothing seems to correct the URL?
What can I do? I would still like to use the relative URL with angularjs.