INDEX

getApplicationURL(DOMString unique_name, Function callback)

Get the URLs and ports required to connect to applications or spacelets web server. If the web server is not implemented or the application implementing the web server is not running edge nodes URLs are returned.

Parameter Description
unique_name Unique name of an application or a spacelet.
callback User defined callback function that is called after the response is available.

After the response is available the callback function is called with two arguments: callback(err, data).

Argument Type Desription
err JSON Object An error_object or null if no error occured.
data JSON Object An URL object containing the URLs and ports.

The URL object has the following fields.

{
"url": string,
"secureUrl": string,
"port": string,
"securePort": string,
"implementsWebServer": boolean,
"unique_name": string,
"type": string
}

The url and secureUrl properties contain the unsecure and secure URLs respectively. The port and securePort properties contain the unsecure and secure ports to the applications or spacelets web server. The URLs consists of host part followed by port. The host part is edges URL edge.spaceify.net.

The implementsWebServer property tells whether the application or spacelet impolements a web server. Its value is false if the web server is not implemented and true if it is.

Unique_name and type properties identify the application or spacelet the URL object belongs to.

As the running status of applications and spacelets may change the URL object might need to be reaquired at some point.

Examples

An URL object could have the following content, if applications web server would be listening unsecure and secure ports 32918 and 32919 respectively.

{
"url": "edge.spaceify.net:32918",
"secureUrl": "edge.spaceify.net:32919",
"port": "32918",
"securePort": "32919",
"implementsWebServer": true,
"unique_name": "spaceify/bigscreen",
"type": "sandboxed"
}

If the same application would have web server but it would not be running, the URL object could have the following content.

{
"url": "edge.spaceify.net",
"secureUrl": "edge.spaceify.net",
"port": null,
"securePort": null,
"implementsWebServer": true,
"unique_name": "spaceify/bigscreen",
"type": "sandboxed"
}
Close
copyright © Spaceify.org 2014