Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions zeppelin-web/app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,34 @@
*/
'use strict';

/** get the current port of the websocket
/** Get the current port of the websocket
*
* In the case of running the zeppelin-server normally,
* The body of this function is just filler. It will be dynamically
* overridden with the zeppelin-site.xml config value when the client
* requests the script. If the config value is not defined, it defaults
* to the HTTP port + 1
* the body of this function is just filler. It will be dynamically
* overridden with the AppScriptServlet from zeppelin-site.xml config value
* when the client requests the script.
*
* If the config value is not defined, it defaults to the HTTP port + 1
*
* At the moment, the key delimiter denoting the end of this function
* during the replacement is the '}' character. Avoid using this
* character inside the function body
* during the replacement is the '}' character.
*
* !!!
* Avoid using '}' inside the function body or you will fail running
* in server mode.
* !!!
*
* In the case of running "grunt serve", this function will appear
* as is.
*/
function getPort() {
var port = Number(location.port);
if (location.protocol !== 'https:' && (port === 'undifined' || port === 0)) {
if (location.protocol !== 'https:' && (port === 'undifined' || port === 0))
port = 80;
} else if (location.protocol === 'https:' && (port === 'undifined' || port === 0)) {
else if (location.protocol === 'https:' && (port === 'undifined' || port === 0))
port = 443;
} else if (port === 3333 || port === 9000) {
else if (port === 3333 || port === 9000)
port = 8080;
}
return port+1;
}

Expand Down