couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damien Katz <dam...@apache.org>
Subject Re: REST, Hypermedia, and CouchApps
Date Wed, 25 Feb 2009 15:33:19 GMT

On Feb 25, 2009, at 12:16 AM, Chris Anderson wrote:
>
>
> Currently, there is no way for an html attachment to a design document
> to link to other resources provided by that design document, absent
> client side scripting, or hardcoding the design document name in the
> html (neither of which are acceptable).
>
> If you are the HTML hosted at /db/_design/foo/index.html and you want
> to provide browsers a link to /db/_view/foo/bar?limit=10 you can't.
> You can link to other attachments in the same design document, very
> easily.
>
> One way to fix this it to give the resources made available by a
> design document a common root. This means we can use hrefs like
> "_show/docid" to link to a show function from an attachment.  So we
> get paths like this:
>
> /db/_design/foo/_view/bar?limit=10
> /db/_design/foo/_show/docid
> /db/_design/foo/index.html
>
> The downside is that the URLs are longer (and that the change would
> break all clients), the upside is the ability to link from one to the
> other (and thus be part of the web).

I think I'm in favor of doing it the longer way. It's more  
consistent.  It will break stuff every client library that uses views,  
but each will be easy to fix.

-Damien

Mime
View raw message