Allow serving everything beneath a baseUrl with a path.

See: https://github.com/freifunkhamburg/ffffng/issues/44
This commit is contained in:
baldo 2017-05-06 18:40:59 +02:00
commit 8de06a0a8a
14 changed files with 85 additions and 55 deletions
app/scripts/services

View file

@ -1,20 +1,22 @@
'use strict';
angular.module('ffffng')
.service('MonitoringService', function ($http, $q) {
.service('MonitoringService', function ($http, $q, config) {
var pathPrefix = config.rootPath === '/' ? '' : config.rootPath;
return {
'confirm': function (token) {
if (!token) {
return $q.reject({});
}
return $http.put('/api/monitoring/confirm/' + token);
return $http.put(pathPrefix + '/api/monitoring/confirm/' + token);
},
'disable': function (token) {
if (!token) {
return $q.reject({});
}
return $http.put('/api/monitoring/disable/' + token);
return $http.put(pathPrefix + '/api/monitoring/disable/' + token);
}
};
});