couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Sheehy <>
Subject Re: Webmachine dispatcher example
Date Thu, 07 May 2009 17:33:00 GMT
I've now changed the dispatcher such that it should be useful outside
of webmachine without affecting internal use.

Check out
if you want to see it.  As with much Erlang, the actual volume of code is
quite small.  It is all Apache2 licensed, so there should be no problem if you
want to use that module in couchdb for this purpose.

The API is quite simple.  Just call webmachine_dispatcher:dispatch/2 with
a path and a list of the dispatch terms I explained in the other
email.  A trivial

1> webmachine_dispatcher:dispatch("/a",[{["a"],some_resource,[]}])

I suspect that you won't have much trouble turning JSON forms into
dispatch terms.

I'm interested to hear how it works out for you, and welcome any suggestions.



View raw message