I'm trying to make a fake CouchDB replication endpoint so I can replicate just one dynamically generated design document to an empty CouchDB database (so, my fake endpoint wants to be only the source of the replication, never the target).
I've followed the description of the protocol at http://docs.couchdb.org/en/latest/replication/protocol.html and wrote views for each of the paths the CouchDB replicator would have to call, in this order: HEAD / -> just says I'm here GET / -> returns {update_seq: "1-initial", instance_start_time: "0"} GET /_local/someidentificator -> 404 GET /_changes (I show only my design doc id, with a _rev of "1-initial") GET /_design/<id>?revs=true&open_revs=all&latest=true At this point I should return a bizarre multipart/mixed response, which I do (you can check it by curling or visiting http://couchapps.alhur.es/fiatjaf/microanalytics/_design/microanalytics?revs=true&open_revs=all&latest=true), but at this point the CouchDB replicator starts to make repeated requests to both / and /_design/<id>?revs=true&open_revs=all&latest=true and I don't know what exactly went wrong. Is it my multipart/mixed response that is wrong? (probably, because it is written by hand, but where is it wrong and how should I be doing this?) or is it something else? Cloudant DBs do not return this multipart/mixed response no matter how much I try, they return a strange JSON array. I know this is a bizarre question, but thanks for reading anyway.
