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 211F6DA7F for ; Thu, 25 Oct 2012 19:26:34 +0000 (UTC) Received: (qmail 54837 invoked by uid 500); 25 Oct 2012 19:26:32 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 54744 invoked by uid 500); 25 Oct 2012 19:26:32 -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 54730 invoked by uid 99); 25 Oct 2012 19:26:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2012 19:26:32 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [66.111.4.28] (HELO out4-smtp.messagingengine.com) (66.111.4.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2012 19:26:25 +0000 Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 5417820716; Thu, 25 Oct 2012 15:26:05 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute4.internal (MEProxy); Thu, 25 Oct 2012 15:26:05 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=rBfuN87KOI3xkQQR91CLlV lBynw=; b=b89w4/rJRfVOj6sHUgUJnsPt0oRSxqkilUfE+KvBWRai+hKKouYvA1 MibXdrPsAtiKz1BrZxiOcL/cPB2ynGVTqWe4UEE4c+Qec+O7H4OL0B+cJ23AoirD sX6yCvaseBRbSlmBYntf5a6iUIRJ5JUebtozU4VQ7FNqDP+48lKTk= X-Sasl-enc: pYaifYfEnkt9H0xz49hlPyXK5LmH3PUkCax6OHvXiV/p 1351193165 Received: from [10.0.1.3] (unknown [78.208.93.24]) by mail.messagingengine.com (Postfix) with ESMTPA id CFF8E4825DF; Thu, 25 Oct 2012 15:26:04 -0400 (EDT) Message-ID: <5089924B.1040804@berjon.com> Date: Thu, 25 Oct 2012 21:26:03 +0200 From: Robin Berjon User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: user@couchdb.apache.org CC: Ryan Ramage Subject: Re: Rewrite inside of a path segment References: <508968F3.9020304@berjon.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 25/10/2012 18:41 , Ryan Ramage wrote: > Wow, I like the idea of a rewriter function. Me too :) > Can you add the function as part of an array of rewrites? maybe like this: > > rewrites : [ > {from : "/something", to : "/somethingelse"}, > "function(req, path) { ...}" > ] I considered that option, but I couldn't find a strong reason to justify the added complexity. And if no one likes writing functions in strings, I doubt anyone would enjoy writing multiple functions as string list items :) Note though that there's nothing in this incompatible with any couchapp system � all that exists just works, and you can take advantage of this just by automatically stringifying functions (which as a matter of fact is what I'm doing). -- Robin Berjon - http://berjon.com/ - @robinberjon