The base URL for this AJAX HTTP request will be the domain address in the address bar of the browser URL.
For example:
Your application runs on https://example.com/user/profileand when executed:
$http.post('/api/authenticate', { username: username, password: password });
Then the browser will execute an AJAX request to https://example.com/api/authenticate
You can get the base url from the browser using
var baseURL = window.location.protocol + '//' + window.location.host;
alert('Base URL for current frame is: ' + baseURL);
Hide result