couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Ramage <ryan.ram...@gmail.com>
Subject Re: HTML documentation within a couch application
Date Thu, 27 Sep 2012 20:13:52 GMT
Ok, there are some simple things to do, and some dragons here.

1. Add and use rewrites. Here are the basics:
https://github.com/garden20/baseline-garden-app/blob/master/couch/ddoc.js#L4
2. Now when you push your app, access it at
http://MY.HOST.NAME/mydb/_design/whatever/_rewrite/blah.html
3. Use relative urls for all your resources.
4. when using ajax to access your couch via a the rewrites (and make
it relative) so  like

5. Now if you want your couchapp to be the root of MY.HOST.NAME then
add to the vhost section of the configuration. An entry like:

[vhosts] my.host.name = /mydb/_design/whatever/_rewrite/

6. This part is cheating. It should not be allowed, but it is so abuse
at your leisure. If you want your couchapp at my.host.name/wiki then
add a vhost like such:

[vhosts] my.host.name/wiki = /mydb/_design/whatever/_rewrite/


So in all cases you should not need to add my.host.name anywhere in
the html. Keeps it nice and portable.

PS. Dragons are in show and list functions. You can pretty much follow
the advice from above for these. But you cant distinguish if your app
is running under case 5 or 6. See
https://issues.apache.org/jira/browse/COUCHDB-1416

Mime
View raw message