I am trying to use jquery.couch.js to perform fist operations in my ember.js application, but I have problems with COS and I don't know what a good solution is.
It seems to me that a couch operating on port 5984 will make it unusable? Why do requests to different ports cause cors problems? And how do OTHER people end up getting a couch for work? I am very confused and do not know how to act.
My couch instance returns this from curl :
{"couchdb":"Welcome","version":"1.2.0"}
The code I'm trying unsuccessfully to run is as follows:
$.couch.urlPrefix = "http://127.0.0.1:5984"; $.couch.login({ name: 'name', password: 'secret' });
I modified the urlPrefix part several times for things like localhost , and removed http:// for both versions.
The error she throws is:
XMLHttpRequest cannot load http://127.0.0.1:5984/_session. Origin http://localhost is not allowed by Access-Control-Allow-Origin.
Help me! I humbly admit my talkativeness to say this, but how is couchdb even useful if it is built right into the basic functions?
Oh, and I include jquery.couch.js as follows:
<script src="http://localhost:5984/_utils/script/jquery.couch.js"></script>
Using this version of jquery:
jQuery JavaScript Library v1.10.2
and using jquery migrate due to previous issues:
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
Edit
I just tried adding crossDomain: true, xhrFields: {withCredentials: true} to my login call, but to no avail. The exact error message. I clearly have no basic concept.