ffffng/app/scripts/services/nodeService.js

25 lines
664 B
JavaScript
Raw Permalink Normal View History

2014-05-12 20:08:19 +02:00
'use strict';
angular.module('ffffng')
.service('NodeService', function ($http, config) {
var pathPrefix = config.rootPath === '/' ? '' : config.rootPath;
2014-05-12 20:08:19 +02:00
return {
'createNode': function (node) {
return $http.post(pathPrefix + '/api/node', node);
2014-05-12 20:08:19 +02:00
},
'updateNode': function (node, token) {
return $http.put(pathPrefix + '/api/node/' + token, node);
2014-05-12 20:08:19 +02:00
},
2016-05-16 18:27:03 +02:00
'deleteNode': function (token) {
return $http.delete(pathPrefix + '/api/node/' + token);
2016-05-16 18:27:03 +02:00
},
2014-05-12 20:08:19 +02:00
'getNode': function (token) {
return $http.get(pathPrefix + '/api/node/' + token);
2014-05-12 20:08:19 +02:00
}
};
});