the console.log in the showBets function is working fine, but not the res.write. Am i misunderstanding how it works? The documentation is not making me any wiser.
app.js
var queryString = 'SELECT * FROM bets';
router.get("/bets",function(req, res){
showBets(res);
res.sendFile(path + "bets.html");
});
function showBets(res){
connection.query(queryString, function(err, rows, fields, res) {
if (err) throw err;
else{
for (var i in rows) {
res.write(rows[i].title);
console.log(rows[i].creator);
}
}
});
}