GitHub user fangq edited a discussion: How to redirect all new PUT /db/doc REST 
calls to updates handler?

I want to thank @janl and @rnewson for answering my question posted at #5493.

as a follow up to that question - if I want to reinforce change-logs and 
creation/update timestamps in my databases, one thing is to implement 
something, such as adding relevant keys and maintain a change-log in the doc, 
in the updates handler. However, I can only add these keys if someone posts 
updated docs via the update handler in the design doc, such as

```
curl -X PUT 
https://example.com:port/dbname/_design/ddoc/_updates/handlername/docname -d 
@"newdoc.json"
```

however, if someone posts a new version of doc via the `PUT /db/doc` API, then, 
this update handler won't be used.

If I want to reinforce this by using update-handler as the only way to 
upload/update docs, I will need to redirect PUT request towards /db/doc to the 
update handler URL. If this is running on my Apache server, I can do this using 
`.htaccess` and `RewriteRule`, but it appears that CouchDB does not use 
`.htaccess`.

is there another way to perform this URL redirect?

GitHub link: https://github.com/apache/couchdb/discussions/5496

----
This is an automatically sent email for notifications@couchdb.apache.org.
To unsubscribe, please send an email to: 
notifications-unsubscr...@couchdb.apache.org

Reply via email to