couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Young <benja...@couchone.com>
Subject Re: rewriter needed changes
Date Fri, 21 Jan 2011 14:44:05 GMT
On 1/20/11 12:37 PM, Benoit Chesneau wrote:
> On Thu, Jan 20, 2011 at 5:27 PM, Benjamin Young<benjamin@couchone.com>  wrote:
>> On 1/20/11 10:45 AM, Benoit Chesneau wrote:
>>> On Thu, Jan 20, 2011 at 4:40 PM, Volker Mische<volker.mische@gmail.com>
>>>   wrote:
>>>
>>>> {
>>>>   "from": "/page/:x/:y/:z",
>>>>   "to": "/_show/post/:x-:y-:z/something",
>>>>   "params": {
>>>>     "x": {
>>>>     "match": "\\d",
>>>>   },
>>>>     "y": {
>>>>     "match": "\\d",
>>>>   },
>>>>     "z": {
>>>>     "match": "\\d",
>>>>   }
>>>> }
>>>>
>>> This one is already possible in current couchapp_legacy rewriter. I'm
>>> not a fan to have something other than :
>>>
>>> patterns: {
>>>      "name1": "regexp",
>>>       ...
>>> }
>>>
>>> It will make the system really complex. Maybe as an option though. I
>>> can detect if I have an object or not. I think it would be better to
>>> say ".*"
>>>
>>>
>>>   (and i need to find a new name for couchapp_legacy)
>>>
>>>
>>> - benońęt
>> I couldn't speak to the complexity of the code as I'm fairly new to Erlang.
>> In any case, I think we need to keep the URL's in "from" and "to" easy to
>> read and provide flexible parsing options with a "standard" (or standard
>> set) available by default.
>>
>> If we support regular expressions, I'd suggest using PCRE over any other as
>> its widely known and used (Django, nginx, PHP, mod_rewrite).
>>
> Well did you read the README ? It's still using From, To. Reverse
> dispatching is still here but improved. It also offer regexp, which
> use re module in erlang based on PCRE. Readme is here:
>
> https://github.com/benoitc/couchapp_legacy
>
> It's using regexp ( or reverse url dispatching.  About regexp it"s
> using re module in erlang based on PCRE.

Yeah, sorry about that. I should have read that more fully. I had 
thought it used Mongrel's stuff--which would be fine as an additional 
option, maybe.

> Url template is a good idea. Are you speaking about:
>
> http://tools.ietf.org/html/draft-gregorio-uritemplate-04 ?

Yep. It still needs work, obviously, but the syntax has some traction 
with groups like OpenSearch:
http://bitworking.org/news/URI_Templates

> It could be implemented using new engine. Also as a side node
> couchapp_legacy is legacy as inheritance or tribute. It doesn't mean I
> want it fully compatible with current one, users can still use old
> rewrite handler. I will change its name during the night.
>
> - benoit


Mime
View raw message