incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Wood <>
Subject PUT/POST to app using rewrites+vhost?
Date Mon, 22 Nov 2010 02:06:16 GMT

  I have rewrites and vhost support working now (thanks for the help!). The next issue I’m
flailing on is how to best perform edits to my database, while still using the nice URL structure.

  With a vhost going to /db/_design/app/_rewrite, all the incoming URLs get written to have
/db/_design/app as a prefix. So, to PUT/POST new/updated documents, I added rewrites of:

		"from": "/*",
		"to": "../../*",
		"method": "PUT"
		"from": "/*",
		"to": "../../*",
		"method": "POST"

  I also played a bit with rewriting to a _update/put function. I never got this approach
working fully before thinking I should just redirect up with ../.. in the rewrite. It seems
harder to use _update than just escape the _design/app namespace this way.

  My question then, is -- is this standard procedure, or should I avoid this approach for
some reason?



View raw message