diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-08-14 13:43:20 +0300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-08-14 13:43:20 +0300 |
commit | d9777620508a7b197f0e5752869eef91d83e20a0 (patch) | |
tree | c247f37ed7621fba2eca775f628a19790a3bbf3c /web/app/controller/Root.js | |
parent | 5d3b7cbe5924d4a4552035626a83e26b1e756255 (diff) | |
download | trackermap-server-d9777620508a7b197f0e5752869eef91d83e20a0.tar.gz trackermap-server-d9777620508a7b197f0e5752869eef91d83e20a0.tar.bz2 trackermap-server-d9777620508a7b197f0e5752869eef91d83e20a0.zip |
Use relative URLs for web app
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r-- | web/app/controller/Root.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index 6d18f4073..9ca7c9e40 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -33,7 +33,7 @@ Ext.define('Traccar.controller.Root', { onLaunch: function () { Ext.Ajax.request({ scope: this, - url: '/api/server', + url: 'api/server', callback: this.onServerReturn }); }, @@ -44,7 +44,7 @@ Ext.define('Traccar.controller.Root', { Traccar.app.setServer(Ext.decode(response.responseText)); Ext.Ajax.request({ scope: this, - url: '/api/session', + url: 'api/session', callback: this.onSessionReturn }); } else { @@ -107,8 +107,8 @@ Ext.define('Traccar.controller.Root', { asyncUpdate: function (first) { var protocol, socket, self = this; - protocol = location.protocol === 'https:' ? 'wss:' : 'ws:'; - socket = new WebSocket(protocol + '//' + window.location.host + '/api/socket'); + protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; + socket = new WebSocket(protocol + '//' + window.location.host + window.location.pathname + 'api/socket'); socket.onclose = function (event) { self.asyncUpdate(false); |