Professional Documents
Culture Documents
Mochiweb/Webmachine
Mochiweb/Webmachine
by Flavio Ishii
Mochiweb
• An Erlang library for building light-weight HTTP
servers.
• Provides manipulation of resources via HTTP
methods: GET/POST/PUT/DELETE.
• Good for large number of lightweight req/resp.
• MIT Licensed.
• Facebook Chat.
$ cd webmachine-read-only
$ make
$ cd /tmp/mywebdemo
$ make
$ ./start.sh
Try creating a Webmachine API
• Create a Webmachine app.
• Follow the instructions given here
http://bitbucket.org/justin/webmachine/wiki/ExampleResources
• Use Mnesia files from my Mnesia tutorial
slides to and create a Webmachine user
resource.
• Create function set for resource.
• Test with curl commands.
• Use wmtrace tool to visualize the path
taken by the HTTP request. Flavio Ishii, Sept. 17, 2009
Webmachine Features
• Authentication
• etag: http caching
• Integrates well with Riak (A
Decentralized JSON Web Database,
also from Basho Technologies)
• Collecta’s API is built in Webmachine
• http://code.google.com/p/mochiweb
• http://bitbucket.org/justin/webmachine/wiki
• http://blog.therestfulway.com
• http://basho.com