Port je posilan pres argv
This commit is contained in:
+1
-7
@@ -125,7 +125,6 @@ function renderTemplate(req, res) {
|
|||||||
var viewsRoot = app.get ('views');
|
var viewsRoot = app.get ('views');
|
||||||
|
|
||||||
for (var budget in templateData.budget) {
|
for (var budget in templateData.budget) {
|
||||||
console.log(typeof templateData.budget[budget]);
|
|
||||||
|
|
||||||
if (typeof templateData.budget[budget] == 'undefined') {
|
if (typeof templateData.budget[budget] == 'undefined') {
|
||||||
templateData.budget.splice (budget, 1);
|
templateData.budget.splice (budget, 1);
|
||||||
@@ -171,7 +170,6 @@ app.get ('/:page?', function (req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function savePost(req, res) {
|
function savePost(req, res) {
|
||||||
console.log (req.body);
|
|
||||||
|
|
||||||
for (var i in req.body) {
|
for (var i in req.body) {
|
||||||
templateData[i] = req.body[i];
|
templateData[i] = req.body[i];
|
||||||
@@ -230,7 +228,6 @@ app.post ('/budget/groups', function (req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.post ('/budget/add_item', function (req, res) {
|
app.post ('/budget/add_item', function (req, res) {
|
||||||
console.log (req.body);
|
|
||||||
var items = req.body.name.length;
|
var items = req.body.name.length;
|
||||||
|
|
||||||
var newGroupsMap = {};
|
var newGroupsMap = {};
|
||||||
@@ -273,7 +270,6 @@ app.post ('/budget/add_item', function (req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.post ('/budget/add_item_in_group', function (req, res) {
|
app.post ('/budget/add_item_in_group', function (req, res) {
|
||||||
console.log (req.body);
|
|
||||||
var items = req.body.name.length;
|
var items = req.body.name.length;
|
||||||
|
|
||||||
var group = req.body.group;
|
var group = req.body.group;
|
||||||
@@ -324,8 +320,6 @@ app.post ('/budget/bought/:group/:item', function (req, res) {
|
|||||||
|
|
||||||
templateData.budget[group].items[item].bought = (req.body.bought == 'true' ? true : false);
|
templateData.budget[group].items[item].bought = (req.body.bought == 'true' ? true : false);
|
||||||
|
|
||||||
console.log (templateData.budget[group]);
|
|
||||||
|
|
||||||
res.end ();
|
res.end ();
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -362,4 +356,4 @@ app.post ('/editor/:page?', function (req, res) {
|
|||||||
res.redirect (redirectUrl)
|
res.redirect (redirectUrl)
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen (8080);
|
app.listen (process.argv[2]);
|
||||||
Reference in New Issue
Block a user