null2 / couch-proxy-experiment

Experiment of how you can build a CouchDB proxy on top of restify.
MIT License
0 stars 0 forks source link

This should interface with restify similar to the static file plugin #1

Open argl opened 11 years ago

argl commented 11 years ago

This should not start a restify server, but should be pluggable like the static file stuff of restify:

server.get(/\/couch\/?.*/, restify.proxyCouch({
  ... couch properties ...
}));

It would also be knorke to have couchdb endpoints white/blacklisted in some way

jo commented 11 years ago

yeees, of course.

jo commented 11 years ago

thats called plugins

jo commented 11 years ago

maybe it should be called like this:

server.use(couch(options));

This way the plugin would not be limited to GET requests...

jo commented 11 years ago

see https://github.com/mcavage/node-restify/blob/master/lib/plugins/static.js

argl commented 11 years ago

both ways could be possible, via use()... (all methods ossible) or via .get() (to only allow gets?

jo commented 11 years ago

stuck because of https://github.com/mcavage/node-restify/issues/289

argl commented 11 years ago

Time to contribute to restify and implement it?

jo commented 11 years ago
// hacky hack for the lack of `all`
jo commented 11 years ago

kiek ma 5236af8b52ed2e5115243781ffeaa018099754e9