aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-14 13:43:20 +0300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-08-14 13:43:20 +0300
commitd9777620508a7b197f0e5752869eef91d83e20a0 (patch)
treec247f37ed7621fba2eca775f628a19790a3bbf3c /web/app/controller
parent5d3b7cbe5924d4a4552035626a83e26b1e756255 (diff)
downloadtraccar-server-d9777620508a7b197f0e5752869eef91d83e20a0.tar.gz
traccar-server-d9777620508a7b197f0e5752869eef91d83e20a0.tar.bz2
traccar-server-d9777620508a7b197f0e5752869eef91d83e20a0.zip
Use relative URLs for web app
Diffstat (limited to 'web/app/controller')
-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);