aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller/Root.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r--web/app/controller/Root.js8
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);