问题
I'm using nodester with iriscouch. I've installed the couchdb-api package. This is my code:
console.log("Running");
//Appears in the logs
var dbServer = require("couchdb-api").srv('eric-wieser.iriscouch.com');
console.log(dbServer);
//Appears in the logs
dbServer.info(function (err, response) {
console.log("Info!");
//Never executed. Logs show:
//Error: ECONNREFUSED, Could not contact DNS servers
// at IOWatcher.callback (dns.js:74:15)
});
Why is this not working? What is that error trying to tell me?
回答1:
Can't help you with nodester, have no experience with it. However that seems to indicate you cannot connected to iriscouch, which might mean you need to give the full url? Does the code work on your local machine?
If you are interested I wrote a blog for couchdb/node beginners yesterday: http://writings.nunojob.com/2011/09/getting-started-with-nodejs-and-couchdb.html
来源:https://stackoverflow.com/questions/7312275/getting-couchdb-to-work-with-node-js