Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 61230 invoked from network); 3 Jan 2010 22:47:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jan 2010 22:47:06 -0000 Received: (qmail 17970 invoked by uid 500); 3 Jan 2010 22:47:04 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 17900 invoked by uid 500); 3 Jan 2010 22:47:04 -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 17890 invoked by uid 99); 3 Jan 2010 22:47:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jan 2010 22:47:04 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of matteo.caprari@gmail.com designates 209.85.219.216 as permitted sender) Received: from [209.85.219.216] (HELO mail-ew0-f216.google.com) (209.85.219.216) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jan 2010 22:46:52 +0000 Received: by ewy8 with SMTP id 8so13834179ewy.35 for ; Sun, 03 Jan 2010 14:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=WrS8P9zAhbrzIQvninXTLd97/qpV7jE6OChOYe6eUC4=; b=HCAeYn9hpBzuIZ4AGHZgEwla+10SyU1Y44dVhgq9Gmm5Dz66uTOrKomA+5KdbY9v/n dGWuuCHdxJ2f66ZzYz+AtgMROPs8nn8D5MrZgTWW82eUKKCdHkYOcBviJDVXRleeK/gE 6r0ggSjTKt9y0wExGI7R78oMbdtez+RzE0G08= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=sOJcuzX4IixS/xep+q9Q1H9F+LGSlvAeXN5Ib0Ba8Yf+HWI26dAg8rnGrW9OUea1r3 IDlVkiURZFEQR1jaSVT63NRTWFg4K0vCmabFuLNdMyi+YRLFd07pQ5BFDvsxn2wwAx0R b9QMPD88f4jpsDEZqvCzjbbDvHplMMownGZ1k= MIME-Version: 1.0 Received: by 10.216.88.79 with SMTP id z57mr980777wee.22.1262558792100; Sun, 03 Jan 2010 14:46:32 -0800 (PST) In-Reply-To: References: <1bca98391001030457m52aca7d8lf77edd06375f41c6@mail.gmail.com> From: Matteo Caprari Date: Sun, 3 Jan 2010 22:46:12 +0000 Message-ID: <1bca98391001031446g211d8983i1abe3a805d08443d@mail.gmail.com> Subject: Re: sample couchdb application To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi. What about testing? Anything worth mentioning? On Sun, Jan 3, 2010 at 7:07 PM, Chris Anderson wrote: > On Sun, Jan 3, 2010 at 4:57 AM, Matteo Caprari wrote: >> Hello list. >> >> I've cranked up a simple couchapp that mimics stackoverflow.com (if you squint). >> >> The idea is to understand couchdb better and provide the base for a >> tutorial, but >> before going any deeper, I'd like to hear from you what is wrong and >> what is good. > > This is great stuff. Really cool. I still don't understand all of how > you've integrated things, but the documentation is really a great > addition. > > I think this is a really cool use case. Thanks for sharing! > > One concern I have is that I don't think you need to be building > custom _ids. You should be able to accomplish your lists and shows > without messing with custom ids, instead using document parameters in > views. Custom ids generally just add code-overhead to apps and > increase the chances of spurious conflicts. > > To avoid double posts, PUT with a random docid should be idempotent, > and fail on duplicate PUTs. If you can't do PUT from your client the > _bulk_docs POST api should work to, if you specify ids. See how > jquery.couch.js has an API for getting UUIDs from the Couch and then > using them on new docs. > > Also, in trunk _show is no longer happy to have bogus ids, you'll get > a 404. You can invoke with no docid at all to accomplish your use > case. > > I'm happy to help more so that when you write your tutorial it > embodies best practices. Just post any questions to this thread! > > Cheers, > Chris > > >> >> So please have a look, but don't expect too much. >> >> Demo: http://caprazzi.net:5984/fortytwo/_design/fortytwo/index.html >> Docs: http://caprazzi.net:5984/fortytwo/_design/fortytwo/docs/index.html >> Source: http://github.com/mcaprari/fortytwo >> >> Docs are created with jsdoc-toolkit and a custom template. >> I think we could integrate it with couchapp to obtain a "view source" feature. >> >> -- >> :Matteo Caprari >> matteo.caprari@gmail.com >> > > > > -- > Chris Anderson > http://jchrisa.net > http://couch.io > -- :Matteo Caprari matteo.caprari@gmail.com