Execute HTTP request to an external server when any CouchDB Data changes
<p>I am fairly new in CouchDB but successfully performed create, update, delete data using Fauxton UI. I have some PouchDB clients which will directly sync with this CouchDB database using HTTP Protocol. This PouchDB client will be authenticated with another ASP.NET Identity server and send a Bearer Token with  each of its call to the CouchDB server. </p>

<p>I have a remote Windows server (exposed with ASP.NET Web API endpoints) which has implementation of Permission Management (using ASP.NET Identity) and also another server which has ElasticSearch database (for fastest searching) instance. </p>

<p><strong>My problem is, I want to execute some functions (using JavaScript, Python or any other supported language) to check the permission with that ASP.NET remote server and if permitted, then proceed the call to the CouchDB. 
I also want to capture the <code>_changes</code> event of CouchDB and execute another HTTP call to my ElasticSearch instance to insert/update this change.</strong> </p>

<p>I have seen, I can write Python/Ruby code to which can execute a HTTP call. But I failed to understand how to hook these functions with my CouchDB (instance/cluster) so that these functions could be called and executed. </p>

<p>Two JS modules that could solve parts of your issues:</p>

<ul>
<li><a href="https://www.npmjs.com/package/follow" rel="nofollow">follow</a>, to execute a function everytime a change happen on the followed CouchDB database</li>
<li><a href="https://github.com/ryanramage/couch2elastic4sync" rel="nofollow">couch2elastic4sync</a>, uses the follow module to keep a CouchDB database and a ElasticSearch index in sync</li>
</ul>

python asp.net oauth couchdb httprequest