I've got two files, one for testing random stuff, and an express controller.
test.js
models.Person.findAll({}).then(function(rows) {
console.log(rows.length); //88
});
personController.js
module.exports = {
getAll: function(req, res) {
models.Person.findAll({}).then(function(rows) {
console.log(rows.length); //does not log
res.send(rows); //won't invoke, client still pending
});
};
};
I can successfully query the sqlite db if it's not in express, but when I put the query in express suddenly it's not working. The sql statements are still being printed to the console successfully, but I can't get the result. This makes me think it's an express problem.
There's a lot of boilerplate stuff I didn't include, but it's working (if it's not using sequelize).
Aucun commentaire:
Enregistrer un commentaire