Added confirmation page for monitoring + a few tweaks.

This commit is contained in:
baldo 2016-05-18 22:50:06 +02:00
parent 1b173b79d4
commit 0bdce5debb
24 changed files with 431 additions and 72 deletions
server/utils

22
server/utils/resources.js Normal file
View file

@ -0,0 +1,22 @@
'use strict';
angular.module('ffffng').factory('Resources', function (_) {
function respond(res, httpCode, data) {
res.writeHead(httpCode, {'Content-Type': 'application/json'});
res.end(JSON.stringify(data));
}
return {
getData: function (req) {
return _.extend({}, req.body, req.params, req.query);
},
success: function (res, data) {
respond(res, 200, data);
},
error: function (res, err) {
respond(res, err.type.code, err.data);
}
};
});