Getting CouchDB to work with node.js

前提是你 提交于 2019-12-12 19:22:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!