couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Landolt <>
Subject Re: REST, Hypermedia, and CouchApps
Date Wed, 25 Feb 2009 15:56:10 GMT
On Wed, Feb 25, 2009 at 10:33 AM, Damien Katz <> wrote:

> 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.

Consistency FTW...

The *long url *problem can easily be remedied with rewriting. There are
already a few nice recipes for proxy configurations -- they could easily be
expanded to rewrite all non _ top level endpoints from *foo* to /db/_design/
*foo*/ automagically.

At some point a utility could be added that allows rewriting to be
configured at the local.ini level (for those of us that want to rock those
stylish *my couch is on port 80 *shirts ;)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message