Repository: incubator-zeppelin Updated Branches: refs/heads/master 052524956 -> b15b20136
getPort should not have curly bracket in its body This patch simply remove the usage of curly bracket in the body of the getPort method of the app.js. This is needed so the AppScriptServlet can do its correctly in case of developement in both client and server sides. Author: Eric Charles <[email protected]> Closes #127 from echarles/app-js-server-mode and squashes the following commits: dfaba55 [Eric Charles] getPort should not have curly bracket in its body Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/b15b2013 Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/b15b2013 Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/b15b2013 Branch: refs/heads/master Commit: b15b20136b8032ea9a1e8ddb40b38b13b91c9e6a Parents: 0525249 Author: Eric Charles <[email protected]> Authored: Sun Jun 28 11:39:18 2015 +0200 Committer: Lee moon soo <[email protected]> Committed: Mon Jun 29 09:34:03 2015 -0700 ---------------------------------------------------------------------- zeppelin-web/app/scripts/app.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/b15b2013/zeppelin-web/app/scripts/app.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/scripts/app.js b/zeppelin-web/app/scripts/app.js index 64a1292..3a2c71f 100644 --- a/zeppelin-web/app/scripts/app.js +++ b/zeppelin-web/app/scripts/app.js @@ -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; }
