Ugly URLs?

11 views
Skip to first unread message

Bjoern

unread,
Jun 3, 2009, 11:53:57 AM6/3/09
to CouchApp
My apologies if this is a very stupid question, but is there a way to
avoid the _design, _list , _show in URLs? I hope I understood
correctly that they would appear in a typical app.

Personally I would not be very happy with that approach - I want
pretty and short URLs for my web apps. Ideally I don't even want to
reveal what kind of technology my web app is running.

Couldn't there be another "trigger" for design docs than putting their
type into the URL? For example, another (hidden) property of
documents?

I suppose one could somehow pipe everything through Apache and use URL
rewriting, but that does not sound very relaxing.

Björn

chris thatcher

unread,
Jun 3, 2009, 12:21:16 PM6/3/09
to couc...@googlegroups.com
I'm a big fan of using Accept headers for content negotiation to keep urls pretty.  This isn't always appropriate but something that could considered as and alternate.
--
Christopher Thatcher

Jason Davies

unread,
Jun 3, 2009, 12:29:00 PM6/3/09
to couc...@googlegroups.com
One of the things I'm working on in my spare time is support for a _rewrite handler, which hopefully will make pretty URLs easier.  Essentially the idea is that you can define your own URL patterns under /dbname/_design/app/_rewrite/ and then use a reverse proxy such as nginx to proxy /(.*) -> /dbname/_design/app/_rewrite/$1

Haven't had time to work on it recently, any ideas welcomed though,

--
Jason Davies

Noah Slater

unread,
Jun 3, 2009, 12:52:22 PM6/3/09
to couc...@googlegroups.com
On Wed, Jun 03, 2009 at 05:29:00PM +0100, Jason Davies wrote:
> One of the things I'm working on in my spare time is support for a
> _rewrite handler, which hopefully will make pretty URLs easier.
> Essentially the idea is that you can define your own URL patterns
> under /dbname/_design/app/_rewrite/ and then use a reverse proxy such
> as nginx to proxy /(.*) -> /dbname/_design/app/_rewrite/$1

I would like to see this supported by CouchDB natively.

--
Noah Slater, http://tumbolia.org/nslater

Bjoern

unread,
Jun 4, 2009, 4:55:58 AM6/4/09
to CouchApp
Thanks for all the replies! I really don't know CouchDB/CouchApp very
well yet, but today somehow I was filled with new hope. I guess URL
rewriting with Apache could be workable for the time being.

But I agree with Noah, I think it really should be supported by
CouchDB natively. And why not - I guess in the end it really is just a
filter that goes before every request, just like all the other
frameworks do it.

Use case in point: today I was thinking about creating an URL
shortener with CouchDB (URL shorteners suck, but sometimes they are
necessary). Obviously having long URLs with _design and _show in them
would not be acceptable.

AW GOOGLE

unread,
Jun 4, 2009, 6:35:51 AM6/4/09
to couc...@googlegroups.com
Bjoern schrieb:

> Thanks for all the replies! I really don't know CouchDB/CouchApp very
> well yet, but today somehow I was filled with new hope. I guess URL
> rewriting with Apache could be workable for the time being.
>
> But I agree with Noah, I think it really should be supported by
> CouchDB natively. And why not - I guess in the end it really is just a
> filter that goes before every request, just like all the other
> frameworks do it.
>
> Use case in point: today I was thinking about creating an URL
> shortener with CouchDB (URL shorteners suck, but sometimes they are
> necessary). Obviously having long URLs with _design and _show in them
> would not be acceptable.

The URL thing was discussed a lot in the last months, especially with upcoming new
CouchApps. I also agree with Noah and wowuld like to see CouchDB manage that (or CouchApp).
Jasons way is for sure cool (see also his blog:
http://www.jasondavies.com/blog/2009/05/08/couchdb-on-wheels/ -> Nginx) but let's think
aboput the enduser of CouchApp's. The easiest way to get a CouchApp running will be to
replicate it from another CouchDB. He will expect that the URL's are "nice" and will not
want to configure his webserver - in most cases he will even not be able to do that
because of missing rights or knowledge.

So maybe this is a feature what we will see in CouchDB in the future.

Cheers

Andy

Reply all
Reply to author
Forward
0 new messages