Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 65648 invoked from network); 24 Sep 2009 22:39:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Sep 2009 22:39:04 -0000 Received: (qmail 67277 invoked by uid 500); 24 Sep 2009 22:39:03 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 67211 invoked by uid 500); 24 Sep 2009 22:39:02 -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 67201 invoked by uid 99); 24 Sep 2009 22:39:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 22:39:02 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zachary.zolton@gmail.com designates 209.85.220.209 as permitted sender) Received: from [209.85.220.209] (HELO mail-fx0-f209.google.com) (209.85.220.209) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 22:38:51 +0000 Received: by fxm5 with SMTP id 5so1669001fxm.3 for ; Thu, 24 Sep 2009 15:38:31 -0700 (PDT) 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=wCIStgxQ+IKiUflyyUypxhKO9ZFHt9x9i4p0yVKDhZ0=; b=a3qgbu5hPXiO+lYiUqcGH8W/JkVe1QEudazyXO3tXS/dVEqtTxI+gFjlwa6Pcs+e2G M98mVLGFF6TtMWgkU8TVthIP+c3owdrvA4l+UFBf2D7noN6GmsLCoWi9fJahEpQth+vp x9N5dUVHOjCJfHQIiKldCN8mWhVeoa6UYcQGc= 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=wx8ZKyltN0xPYpH//AxhRB1Rb3wMDDmgwdqrcolIoH9lit9g5BLAyYsAkpoaVPXHln 4AZ5sbINXPrIL+xFolASnZV1l+JwKKwkzXHXD5wYypY7VV+TE8u0jxh74QPqwHmOq4Jp 7O4p5Jtl7ljKjwIEe+ZYwBxd0etra4eeIlUas= MIME-Version: 1.0 Received: by 10.204.175.83 with SMTP id w19mr3537087bkz.24.1253831911228; Thu, 24 Sep 2009 15:38:31 -0700 (PDT) In-Reply-To: References: From: Zachary Zolton Date: Thu, 24 Sep 2009 17:38:11 -0500 Message-ID: Subject: Re: CouchDB _show and 404? To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org My apologies! I just re-read the wiki and saw my answer: function(doc, req) { if(doc) { // regular doc display logic } else { // document not found if(req.docId) { // HANDLE MISSING DOC HERE!! } else { // handle unspecified doc id } } } RTFM-FTW! :^P On Thu, Sep 24, 2009 at 3:31 PM, Chris Anderson wrote: > On Thu, Sep 24, 2009 at 12:27 PM, Zachary Zolton > wrote: >> Guys, >> >> Does CouchDB provide any hooks for me to execute some custom logic >> when a _show request points to non-existent docid? >> > > The problem with opening this up is that if devs are naive they might > end up treating 404s and cases where no docid was specified as the > same. > > Probably that's not a big deal. Count me as in favor of exploring an > API like you suggest. > >> Otherwise, I'm guessing it'd be best just to hack around this in my >> nginx proxy... >> >> >> Cheers, >> >> Zach >> > > > > -- > Chris Anderson > http://jchrisa.net > http://couch.io >