basho/webmachine — pull request #127 by kellymclaughlin (2013-02-21 06:32:47+00:00)
Title: Allow multiple webmachine instance to run in the same app

Changes to allow multiple instances of webmachine to coexist within
the same erlang application. The instances can use distinct dispatch
tables and be configured to listen on different IP addresses or port
numbers.

The current behavior is maintained as the default, but maybe
overridden by setting `default_router` to `false` in the application
environment and starting named router processes from the application
supervisor prior to calling `webmachine_mochiweb:start`.

The key is to provide a distinct name for each router using `webmachine:start_link/1` and to include that name as the value for the `name` key in the `Config` passed to `webmachine_mochiweb:start/1`.