couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Berjon <ro...@berjon.com>
Subject Re: Rewrite inside of a path segment
Date Thu, 25 Oct 2012 19:26:03 GMT
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

Mime
View raw message