update docs to handle demo and production servers as well as localhost dev.
This commit is contained in:
+19
-13
@@ -50,22 +50,28 @@ function clickAPILink(apiLink)
|
|||||||
|
|
||||||
function getBaseURL(docURL)
|
function getBaseURL(docURL)
|
||||||
{
|
{
|
||||||
var hostName = "";
|
var localhostUrl = "https://localhost:8443/mifosng-provider/api/v1/";
|
||||||
if (QueryParameters["hostname"]) hostName = QueryParameters["hostname"];
|
var openmfDemoUrl = "/mifosng-provider/api/v1/";
|
||||||
else
|
|
||||||
|
var baseUrl = "";
|
||||||
|
|
||||||
|
if (docURL.substring(0,4).toLowerCase() == "http")
|
||||||
{
|
{
|
||||||
if (docURL.substring(0,4).toLowerCase() == "http")
|
var l = getLocation(docURL);
|
||||||
{
|
|
||||||
var l = getLocation(docURL);
|
if (l.hostname == "demo.openmf.org") {
|
||||||
hostName = l.hostname;
|
baseUrl = openmfDemoUrl;
|
||||||
}
|
} else {
|
||||||
else
|
baseUrl = "https://" + l.hostname + ":8443/mifosng-provider/api/v1/"
|
||||||
{
|
|
||||||
//assume running locally
|
|
||||||
hostName = "localhost";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "https://" + hostName + ":8443/mifosng-provider/api/v1/";
|
else
|
||||||
|
{
|
||||||
|
//assume running locally
|
||||||
|
baseUrl = localhostUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user