0

I am trying with Couchdb for the first time and I have now a database with some documents which I run on my localhost(port 5984). I have this smal Web application, also running on localhost but port 3000.

I'm trying with jQuery.getJSON to GET some data out of Couchdb but of course it fails because of the security reasons - if the Web application and the Couchdb have different domains as here, it trigger "NetworkError: 404 Not Found - http://localhost:3000

I am used to RDBMS which usually I create a connection and here I don't know how to continue. Do you have any suggestion?

Madeline
  • 1,039
  • 2
  • 11
  • 19

1 Answers1

0

The simplest option would be for you to make a request to your own server which in turn makes a request to the CouchDB server.

Another option is to setup a proxy either at Nginx/Apache or if your app server supports it, then it could reside there.

3rd option is to create a design document in your CouchDB database, and set the access-control-allow-origin header for a given view to *

Sources:

CouchDB cross-domain access from XMLHttpRequest?

http://guide.couchdb.org/draft/show.html

Community
  • 1
  • 1
Ali
  • 473
  • 2
  • 7