> On May 21, 2015, at 1:56 AM, [email protected] wrote: > > - So the CouchbaseLiteListener internally creates a HTTP server on the > device itself and all the REST API calls are submitted to this local HTTP > server on the device itself. > The actual magic of inserting/updating data happens inside the > CouchbaseLiteListener .
It’s not really going through an HTTP server. The listener just sets up an NSURLProtocol that instructs WebKit / CFNetwork to route all HTTP requests for the host “lite.couchbase.” to its own handlers instead of sending them over the network. This is a lot more lightweight (and secure) than going through a socket. > - Why CouchBaseLite chose this round about way of invoking the plugin ? > Wouldn't it have been easier if they would have provided a one to one mapping > of the JS APIs in the pluging itself. Couchbase Lite does not have a JavaScript API. In addition to its native API (Objective-C or Java or C#) there is a REST API, as defined by CouchDB <http://docs.couchdb.org/en/latest/api/index.html> There are a number of JS convenience wrappers people have created around this, with different APIs, and you’re free to choose whichever one you want. There happens to be a different CouchDB compatible database, PouchDB, that’s implemented directly in JS and has its own direct JS API. Maybe in the future we’ll implement a similar API that directly calls into Couchbase Lite, but that’s not something we’ve decided to do yet. —Jens -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/FCB41D01-0C59-4EA9-9657-2554CEA31F21%40couchbase.com. For more options, visit https://groups.google.com/d/optout.
