Using CouchDB's jquery.couch.js?
Asked Answered
A

3

6

Here http://blog.couchone.com/post/1027100082/whats-new-in-couchdb-1-0-part-4-securityn-stuff it says that jquery.couch.js is the standard JavaScript API that ships with CouchDB.

But how do i get the jquery.couch.js file from couchdb so I could use it's functions ($.couch.signup, $.couch.login etc) in my Sproutcore application or another frontend application?

Amimia answered 11/2, 2011 at 23:32 Comment(2)
Hello Weng. I have been trying to do the same thing with my Sproutcore app. Wondering if you have had any success creating users, logging in, authentication and authorization with couchdb, etc. Any pointers? Samples? -ThanksRawalpindi
Related question here.Levanter
V
9

Futon uses this API itself, so you can see where it includes it, as well as other dependencies it may have, depending on what you'll be doing. Since the CouchDB server can serve up HTTP requests, you can also pull in the dependencies like Futon does.

<script type="text/javascript" src="http://localhost:5984/_utils/script/jquery.couch.js"></script>

Obviously you'll change the hostname to match your couchapp's hostname.

Veloz answered 12/2, 2011 at 0:24 Comment(0)
A
2

I agree with Dominic but also want to add that just linking directly to _utils is not a great idea because your app will not work on iPhone's safari browser. There's already a post on stackoverflow talking about this: Simple CouchDB + jQuery mobile app loads list fine in desktop browsers, just not mobile

So indeed you should use what ships with _utils as your source but instead of linking directly to it, you may want to copy it over to the vendor/couchapps directory as recommended in the post above, if you care about mobile browsers.

Apostle answered 2/11, 2011 at 18:53 Comment(0)
K
0

It looks like futon is deprecated in year 2019 and you wont get those _utils file from fauxton such as _utils/script/jquery.couch.js or jquery.js, jquery.couch.js anymore.

Kanara answered 10/8, 2019 at 7:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.