I have configured a web application that works, and now I want to learn how to properly debug it without using console.log. I have install and run Node -Inspector via Node -debug server.js (the main script file), and I want to use and check what happens when I set a breakpoint for the example in the next post function.
.post('/login', function (req, res){
var user = {
username: req.body.username,
password: hash(req.body.password)
};
db.findOne(user, function (err, data) {
if (data) {
req.session.userId = data.id;
res.redirect('/');
} else {
res.redirect('/login');
}
});
})
Node , , Google Chrome JavaScript (jQuery ..). , . , "var user", jst "timer.js" somesort setImmediate. , , , post req, res res ..
NodeJS v0.12.2 Node -indpector 0.10.0.
body-parser, bourne, express express-session . , , , 8080 5858, .js , - , () js.
, if, . timers.js , .
, ?
.