Simple examples without Coax

67 views
Skip to first unread message

Georges Gabereau

unread,
Oct 9, 2013, 5:43:44 PM10/9/13
to mobile-c...@googlegroups.com
Hey all,

I'm going through the process of creating a simple CBLite app in PhoneGap using the plugin.

I have an app that uses Backbone and I'd like to write a Backbone.sync that works seamlessly with CBLite. I think there might be a lot of people that could benefit from this. All the examples use coax and I've never used that, so I'm not totally clear on how required it is to speak to CBLite.

I am trying to do all my interactions through $.ajax as provided by Zepto or jQuery.

Here's a quick little Gist that shows my uber basic test ajax call to CBLite in PhoneGap:


Here are some URLs I hit (in order) and the responses I got:

response: {"ok": true}

response: {"db_name": "test_db", "doc_count": 0.... etc

Params: {"first_name": "georges"}
response: {"status": 502, "error":"Invalid response from remote replication server"}

response: 404 !

So, what setting am I missing here? 
I thought that I could use CBLite as a local storage mechanism even if remote replication wasn't set up.

Thanks,

Georges

Efkan Türen

unread,
Nov 5, 2014, 3:09:49 AM11/5/14
to mobile-c...@googlegroups.com
+1

J. Chris Anderson

unread,
Dec 4, 2014, 5:14:46 PM12/4/14
to mobile-c...@googlegroups.com
Sorry about the delated reply. You shouldn't need coax (it's just a URL munger around XHR so it doesn't matter how you create your URLs). You might look at existing CouchDB Backbone libraries for examples of connecting to the _changes feed.

That 502 response doesn't make any sense to me. Are you on iOS or Android?

Chris
Reply all
Reply to author
Forward
0 new messages