diff --git a/main.js b/main.js index a2bc259..38fd567 100644 --- a/main.js +++ b/main.js @@ -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() }) @@ -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) }) } diff --git a/package.json b/package.json index c5e57cf..35b9c5d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ , "main" : "./main" , "dependencies": { "watch": "*" - , "request": "*" + , "request": "2.9.150" } , "bin": { "couchapp" : "./bin.js" } }