From d9777620508a7b197f0e5752869eef91d83e20a0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 14 Aug 2016 13:43:20 +0300 Subject: Use relative URLs for web app --- web/app/controller/Root.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'web/app/controller') 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); -- cgit v1.2.3