Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,10 @@ function createApp (doc, url, cb) {
request({uri:url, method:'PUT', body:body, headers:h}, function (err, resp, body) {
if (err) throw err;
if (resp.statusCode !== 201) throw new Error("Could not push document\n"+body)
app.doc._rev = JSON.parse(body).rev
app.doc._rev = body.rev
console.log('Finished push. '+app.doc._rev)
playSound();
request({uri:url, headers:h}, function (err, resp, body) {
body = JSON.parse(body);
app.doc._attachments = body._attachments;
if (callback) callback()
})
Expand Down Expand Up @@ -303,7 +302,7 @@ function createApp (doc, url, cb) {
if (err) throw err;
if (resp.statusCode == 404) app.current = {};
else if (resp.statusCode !== 200) throw new Error("Failed to get doc\n"+body)
else app.current = JSON.parse(body)
else app.current = body
cb(app)
})
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
, "main" : "./main"
, "dependencies":
{ "watch": "*"
, "request": "*"
, "request": "2.9.150"
}
, "bin": { "couchapp" : "./bin.js" }
}