couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <>
Subject Re: _rewrite handler
Date Sat, 05 Dec 2009 22:45:22 GMT
On Sat, Dec 5, 2009 at 8:15 PM, Roger Binns <> wrote:
> Hash: SHA1
> Benoit Chesneau wrote:
>> what would do this doc?
> Nothing in particular - it would just be provided to the _rewrite handler
> Javascript code to do with as it pleases with no prescribed behaviour.

? there is no prescribed behaviour

> The ways I would use it if it existed:
> - - Rewrite to different URIs depending on if the request comes from an
> internal or external location.  The doc would have a list of subnets
> considered internal.

main point of _rewrite handler is to rewrite urls in a couchdb node or
even cluster not on different subnets. Proxies are better for that.

> - - If my app had 10 components, I'd store in the doc which ones are active
> and which disabled (eg disabled ones could be redirected to a page
> explaining that).

not sure to understand here why it couldn't works. make your rules per
component. If you want ro be restful anyway, rules are per resources
> - - I'd prefer to have my rules listed as data with my Javascript code
> applying them.  With the current approach a Javascript has to be regenerated
> on any rule change.

urls don't change often. Current system allows you to define your own
system to rewrite urls. Sometimes you want to rewrite depending on
http verb, other depending on auth or simply on path and there are
different need for rewriting on patch too.  The current design allow
you to define your own way to do this. You could always make a
template that allows you to create your own set of rules.

One other handler I have in mind is an alias handler who could keep
results based on a view so you could eventually associate alias to
docid and useit as url. Useful for shows for example. But that's just
an idea for now.

- benoît

View raw message