From user-return-21218-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Jun 13 19:29:07 2012 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0DFEF98C9 for ; Wed, 13 Jun 2012 19:29:07 +0000 (UTC) Received: (qmail 14489 invoked by uid 500); 13 Jun 2012 19:26:17 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 67604 invoked by uid 500); 13 Jun 2012 19:24:48 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 62231 invoked by uid 99); 13 Jun 2012 18:00:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 18:00:21 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.220.180] (HELO mail-vc0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 18:00:15 +0000 Received: by vcbfk26 with SMTP id fk26so579556vcb.11 for ; Wed, 13 Jun 2012 10:59:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:content-type:x-gm-message-state; bh=QbEWmg+WJKYtgGEILzf/E761VAkL86qFH9vNkDQZZBI=; b=hToz/Jm2+JA0Ct4/D8P2xIPjTYc08QbL3lWr559uAveRTJb3WokK7i2AGF1aAePTYv 6Sgz1ZaTI1izmzYMl36BCApVfd1MhyhUSqsoUqxQk1OFinbFYlAmJEo8dea5fzENBqPB WCPMFoOUahYf9aMFStA7pIBgH3s3zlD/scEWCS6azOgNWVva5LkV8E+hA+ldlW4PRK7H 5NM4WelvqL0P4vIx4ubpgDjgMvCCF1TctiLnh6Cyi+UT1cTQ4FMxJ41v6P6tShYhCNsN Vcj5728SC9E4SZzwSFo3Q1RqW2L4Qm1608jUQwje0wbyvUGSV0hnidXf4hQZOSHwz+FG ujRA== Received: by 10.52.64.146 with SMTP id o18mr14541672vds.55.1339610394344; Wed, 13 Jun 2012 10:59:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.186.163 with HTTP; Wed, 13 Jun 2012 10:59:34 -0700 (PDT) X-Originating-IP: [68.5.117.177] In-Reply-To: References: From: Mark Hahn Date: Wed, 13 Jun 2012 10:59:34 -0700 Message-ID: Subject: Re: Node.js client for CouchDB To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf3079bcb6b13cad04c25e59e9 X-Gm-Message-State: ALoCoQlRQ7feq2Ax+C5kdo2GpLi0OhbMRsYII/szio1NwpQW8Od7qzraoRUkeYDzEAUYDmX3BLtt X-Virus-Checked: Checked by ClamAV on apache.org --20cf3079bcb6b13cad04c25e59e9 Content-Type: text/plain; charset=ISO-8859-1 The hard part is the jquery emulator. I can send you a copy of both when I get a chance. On Wed, Jun 13, 2012 at 6:01 AM, Pulkit Singhal wrote: > Hey Mark, > > Sorry for the confusion, instead of jquery.couchdb.js, I meant did you > ever open-source your modified version of it. > > On Fri, Jun 8, 2012 at 2:57 PM, Mark Hahn wrote: > > > > The code that you modularized, rewrote and purged sync from > > > > It's the jquery.couchdb.js library that is included in the couchdb > > distribution. It's not great code, but it is what futon uses. > > > > > What do you mean here? "no benefit in my code > > > > I discovered that because of security concerns I had to proxy db calls > from > > the browser through node. Otherwise anyone could use the same library to > > do anything they wanted to my couchdb. If couchdb had a decent security > > system this wouldn't be a problem. Anyway, since I had to go through > node > > code anyway, it was cleaner to use nano from that code than to use my > fake > > jquery. The proxy is a very small amount of clean code, thanks to nano's > > simplicity. > > > > > I'm not sure if nano is offering authN or https > > > > I wouldn't know. I'm just using it on localhost. I think one of the > > advantages of couchdb is that it is easy to run a copy on every server > and > > use the replication to share data across servers. So I always use > > localhost. > > > > On Fri, Jun 8, 2012 at 12:13 PM, Pulkit Singhal > >wrote: > > > > > Ahoy Mark! Thank you so much for validating that I'm not the 1st person > > > ever who thought of reusing futon. > > > > > > Some follow-up Qs: > > > > > > 1) The code that you modularized, rewrote and purged sync from ...Is it > > > available on GitHub or somewhere else in the open source community by > any > > > chance? > > > > > > 2) What do you mean here? > > > "no benefit in my code to having the same code run both places" > > > > > > 3) I'm not sure if nano is offering authN or https so I'm still looking > > > into that. I had started out rolling my own non-re-usable solution by > > using > > > Mikeal's request module but I wised up and am looking into Nano now. > > Slowly > > > but surely. Cradle's next, thanks to all the folk who pointed it out. > > > > > > On Fri, Jun 8, 2012 at 12:25 PM, Mark Hahn wrote: > > > > > > > > I find myself wondering why someone hasn't simply taken the > > javascript > > > > code that > > > > runs Futon and dropped it into a node.js module? > > > > > > > > I did something like that. I wrote a module that was a clone of > jQuery > > > > that just implemented the ajax with http.requests. Then I made minor > > > mods > > > > to the jquery code supplied with futon to make it a module. So I > was > > > able > > > > to write DB code that ran on the server and client with no mods. > > > > > > > > I found 3 reasons to not do this ... > > > > > > > > 1) The futon driver used a sync ajax call which was impossible to > > > implement > > > > in node. I had to rewrite some of the code. The person at microsoft > > who > > > > decided to include an sync call should be shot, as well as the futon > > > coder > > > > who used it. > > > > > > > > 2) The futon driver used non-standard callback returns. Different > > > > callbacks were used for success and error. > > > > > > > > 3) I discovered there was no benefit in my code to having the same > code > > > run > > > > both places. > > > > > > > > So I switched to nano. I love nano. I'm using rpc's over socket.ioto > > > get > > > > db access from browser. > > > > > > > > > > --20cf3079bcb6b13cad04c25e59e9--