incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <bchesn...@gmail.com>
Subject Re: Rewrite inside of a path segment
Date Thu, 25 Oct 2012 17:50:38 GMT
On Thu, Oct 25, 2012 at 6:41 PM, Ryan Ramage <ryan.ramage@gmail.com> wrote:
> Wow, I like the idea of a rewriter function. It does add a lot of
> power. Some things to consider...
>
> I know others had rewriter rewrites in mind, namely benoit and jhs.
> Would be nice if they thought this was inline with their ideas. Just
> if we introduce it now like this we want to make sure its compatible
> with the ideas.
>
> Can you add the function as part of an array of rewrites? maybe like this:
>
> rewrites : [
>    {from : "/something", to : "/somethingelse"},
>    "function(req, path) { ...}"
> ]
>
>
> If moved ahead, I also would want to just have a check on
> erica/couchapp tools to make sure could handle this syntax. No one
> likes writing js functions inside of strings in a json file :)
>

Well first version of the rewriter was based on a function [1]. After
long discussions it wasn't accepted for performances reasons. I'm not
sure we should accept it for now until we change the js evaluation.

My other experiments for the rewriter are on the couchapp-ng repo [2].
I have another try coming but it is using my new elixir [3] app
engine.

- benoƮt

[1] https://github.com/benoitc/couchdb/commit/32783433b9f0030a9e6ac2f995d6cd7098794921
[2] https://github.com/benoitc/couchapp-ng
[3] http://elixir-lang.org/

Mime
View raw message