couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Franck Eyraud <>
Subject Re: Having troubles with rewrites
Date Tue, 08 Oct 2013 13:23:36 GMT
Hi Mark,
> Ok so now I've added a rewrites.js file to my Couchapp root folder. In this
> js file I have...
> [
>     {
>         "method": "GET",
>         "from": "/home",
>         "to": "app/index.html",
>     }
> ]
In my couchapp rewrites.js file, I don't have any heading / in the from 
entry, but it could be that it works anyway.

For this rewrite to work, you need an attachment to the design doc 
called app/index.html (or a file _attachments/app/index.html in your 
couchapp project). Is this the case ?

Did you check you vhost entry ? database/_design/designdocname/_rewrite

One very good hint to know what is going on is looking at the couch.log 
file, since the rewritten path is showed there, so you can understand 
what the rewrite engine is doing.
> Also, I keep "services" open the background restart Couch after nearly
> every change. When you change one of the ini's, you have to.
Do you know that you can edit the config on the fly ? Either with futon by editing the vhosts/hostname 
key or with curl doing

|curl -XPUT -d'"||rednecks/_design/rednecks/_rewrite"' http://admin:password@|

Both these methods don't require a couchdb restart (reload is done 
automatically). Very handy !


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