Skip to content

Commit

Permalink
made both uuid and (new) database info optional in request information
Browse files Browse the repository at this point in the history
  • Loading branch information
natevw committed Feb 24, 2011
1 parent 3a456bb commit 49089ed
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions _attachments/couch.node.js
Expand Up @@ -152,10 +152,27 @@ function External2(callback, options) {
}
}

options.db.uuid(function (uuid) {
wrappedReq.uuid = uuid;
if (options.db_info && options.uuids) {
options.db.uuid(function (uuid) {
wrappedReq.uuid = uuid;
options.db.get("/", null, function (dbinfo) {
wrappedReq.info = dbinfo;
callback(wrappedReq, respond);
});
});
} else if (options.db_info) {
options.db.get("/", null, function (dbinfo) {
wrappedReq.info = dbinfo;
callback(wrappedReq, respond);
});
} if (options.uuids) {
options.db.uuid(function (uuid) {
wrappedReq.uuid = uuid;
callback(wrappedReq, respond);
});
} else {
callback(wrappedReq, respond);
});
}
});
});
server.listen(options.port, options.host);
Expand Down

0 comments on commit 49089ed

Please sign in to comment.