ffffng/server/router.js
2016-06-04 11:41:57 +02:00

24 lines
750 B
JavaScript

'use strict';
angular.module('ffffng').factory('Router', function (
app,
NodeResource,
MonitoringResource,
TaskResource
) {
return {
init: function () {
app.post('/api/node', NodeResource.create);
app.put('/api/node/:token', NodeResource.update);
app.delete('/api/node/:token', NodeResource.delete);
app.get('/api/node/:token', NodeResource.get);
app.put('/api/monitoring/confirm/:token', MonitoringResource.confirm);
app.put('/api/monitoring/disable/:token', MonitoringResource.disable);
app.get('/internal/api/task/all', TaskResource.getAll);
app.put('/internal/api/task/run/:id', TaskResource.run);
}
};
});