malayhm commented on a change in pull request #3462: ZEPPELIN-4138 Zeppelin
Notebooks in vue.js framework
URL: https://github.com/apache/zeppelin/pull/3462#discussion_r329308665
##########
File path: zeppelin-web-vue/src/services/api.js
##########
@@ -0,0 +1,33 @@
+export default {
+ getWebsocketUrl () {
+ let wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:'
+ return wsProtocol + '//' + location.hostname + ':' + this.getWSPort() +
'/ws'
+ },
+
+ getWSPort () {
+ if (location.hostname.includes('qubole')) {
+ if (location.protocol === 'https:') {
+ return 443
+ }
+ }
+ return this.getPort()
+ },
+
+ getPort () {
+ let port = Number(location.port - 1)
+ if (!port) {
+ port = 80
+ if (location.protocol === 'https:') {
+ port = 443
+ }
+ }
+ if (port === 3333 || port === 9000) {
Review comment:
I have refactored the logic. Now one can update the ports through .env file.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services