couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ermouth <ermo...@gmail.com>
Subject Re: [PROPOSAL] Allow rewrites to be JS function
Date Fri, 16 Oct 2015 12:19:34 GMT
Closing proposal off.

If someone wants to carry it on, current state is:

https://github.com/ermouth/couchdb-chttpd/commit/8e50451aec2b07f95b9115dddc9b33b512651026
https://github.com/ermouth/couchdb-couch/commit/54b4324eeefe27431f5b42a89226b1ea63e17eb6
https://github.com/ermouth/couchdb/commit/4d2d91ed67ed982ff2667cafa5c308e1a95350bc
https://github.com/ermouth/couchdb-couch-mrview/commit/ae7ff262a8ace666891d6c9af5386ed2d1910303

It all works pretty fine and tested, but with own tests, since I was unable
to overcome CouchDB test set in reasonable time – so no PR.

Current syntax example:

rewrites: function(req) {
  // req is similar to req obj in list fn, but without .id, .info, .uuid,
.form
  return {
   // path is mandatory
   path:"/some/path?with=query&some=params",
   // other fields are optional
   headers:{/*headers go here*/},
   method:"POST",
   code:404,
   body:JSON.stringify([1,2,3])
  }
}

ermouth

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message