ffffng/server/router.js

34 lines
1.2 KiB
JavaScript
Raw Normal View History

2014-05-12 20:08:19 +02:00
'use strict';
angular.module('ffffng').factory('Router', function (
app,
2016-06-07 14:08:04 +02:00
FrontendResource,
NodeResource,
MonitoringResource,
TaskResource
) {
2014-05-12 20:08:19 +02:00
return {
init: function () {
2016-06-07 14:08:04 +02:00
app.post('/', FrontendResource.render);
2014-05-12 20:08:19 +02:00
app.post('/api/node', NodeResource.create);
app.put('/api/node/:token', NodeResource.update);
2016-05-16 18:27:03 +02:00
app.delete('/api/node/:token', NodeResource.delete);
2014-05-12 20:08:19 +02:00
app.get('/api/node/:token', NodeResource.get);
2016-05-23 22:36:27 +02:00
app.put('/api/monitoring/confirm/:token', MonitoringResource.confirm);
app.put('/api/monitoring/disable/:token', MonitoringResource.disable);
2016-06-04 14:58:11 +02:00
app.get('/internal/api/tasks', TaskResource.getAll);
app.put('/internal/api/tasks/run/:id', TaskResource.run);
app.put('/internal/api/tasks/enable/:id', TaskResource.enable);
app.put('/internal/api/tasks/disable/:id', TaskResource.disable);
2016-06-07 00:21:26 +02:00
app.put('/internal/api/nodes/:token', NodeResource.update);
app.delete('/internal/api/nodes/:token', NodeResource.delete);
app.get('/internal/api/nodes', NodeResource.getAll);
app.get('/internal/api/nodes/:token', NodeResource.get);
2014-05-12 20:08:19 +02:00
}
};
});