rewrites.json not rewrites.js
On 11 November 2013 00:03, Alexander Gabriel <a...@barbalex.ch> wrote: > Hi > > I have a couchapp on http://arteigenschaften.ch. > It's built with the original python couchapp tool. > > My goal: > Instead of > "http://arteigenschaften.ch/artendb/_design/artendb/index.html" > the url should look like: > "http://arteigenschaften.ch/index.html<http://arteigenschaften.ch/artendb/_design/artendb/index.html> > " > > In local.ini I have: > [vhosts] > arteigenschaften.ch:5984 = /artendb/_design/artendb/_rewrite > After uploading the local.ini file I do: "service couchdb restart" to apply > it. > > In my project root I have a file "rewrites.js" with this rule: > [ > { > "method": "*", > "from": "/artendb/_design/artendb", > "to": "" > } > ] > > This is copied into the design document by the couchapp tool. > > What am I missing to make it work? > > > > ***************** > Side issue: > > What seems rather odd to me is that the rewrites rules are copied not as > clean json but as a string: > > "rewrites": "[\r\n\t{\r\n\t\t\"method\": \"*\",\r\n\t\t\"from\": > \"/artendb/_design/artendb\",\r\n\t\t\"to\": \"\"\r\n\t}\r\n]" > > > I once got an error in the frontend saying that rewrites should be json not > text but weird enough this message has not reappeared. > > Anyway, I have changed the rewrites rule in the design document in futon to: > > "rewrites": [ > { > "method": "*", > "from": "/artendb/_design/artendb", > "to": "" > } > ], > > > This is nicer but - sigh - doesn't work either. > > > Thanks for help. > > Alex