Allow serving everything beneath a baseUrl with a path.
See: https://github.com/freifunkhamburg/ffffng/issues/44
This commit is contained in:
parent
3d6fb5feec
commit
8de06a0a8a
14 changed files with 85 additions and 55 deletions
app/scripts
|
@ -1,10 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('ffffng')
|
||||
.directive('fFooter', function ($http) {
|
||||
.directive('fFooter', function ($http, config) {
|
||||
var pathPrefix = config.rootPath === '/' ? '' : config.rootPath;
|
||||
|
||||
var ctrl = function ($scope) {
|
||||
$scope.version = '?';
|
||||
$http.get('/api/version')
|
||||
$http.get(pathPrefix + '/api/version')
|
||||
.then(function (result) { $scope.version = result.data.version; });
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('ffffng')
|
||||
.service('NodeService', function ($http) {
|
||||
.service('NodeService', function ($http, config) {
|
||||
var pathPrefix = config.rootPath === '/' ? '' : config.rootPath;
|
||||
|
||||
return {
|
||||
'createNode': function (node) {
|
||||
return $http.post('/api/node', node);
|
||||
return $http.post(pathPrefix + '/api/node', node);
|
||||
},
|
||||
|
||||
'updateNode': function (node, token) {
|
||||
return $http.put('/api/node/' + token, node);
|
||||
return $http.put(pathPrefix + '/api/node/' + token, node);
|
||||
},
|
||||
|
||||
'deleteNode': function (token) {
|
||||
return $http.delete('/api/node/' + token);
|
||||
return $http.delete(pathPrefix + '/api/node/' + token);
|
||||
},
|
||||
|
||||
'getNode': function (token) {
|
||||
return $http.get('/api/node/' + token);
|
||||
return $http.get(pathPrefix + '/api/node/' + token);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue