Skip to content

Commit

Permalink
fixed pouchdb JSON.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-aladev committed Oct 31, 2016
1 parent 6f40454 commit 31545a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/express-pouchdb/lib/routes/changes.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ module.exports = function (app) {
cleanup();
} else { // do the longpolling
// mimicking CouchDB, start sending the JSON immediately
res.write('{"results":[\n');
// res.write('{"results":[\n');
req.query.live = req.query.continuous = true;
changes = req.db.changes(req.query)
.on('change', function (change) {
res.write('{"results":[\n');
utils.writeJSON(res, change);
res.write('],\n"last_seq":' + change.seq + '}\n');
cleanup();
Expand Down

0 comments on commit 31545a0

Please sign in to comment.