nlf/mudskipper — pull request #13 by latentflip (2014-02-05 15:22:50+00:00)
Title: Make mudskipper not a singleton.

- This means that when hapi supports multiple instances of the same plugin mudskipper will work.
- This also allows you to access Mudskipper directly, so that you can instantiate the module multiple times independently (not as a plugin) without hapi complaining.

example usage standalone in another hapi plugin:

```javascript
var Mudskipper = require('mudskipper');

exports.register = function (plugin, options, next) {
plugin.loader(require);
var mudskipper = new Mudskipper({
makeRoutes: plugin.route.bind(plugin)
});

mudskipper.buildRoutes({
resources: {
users: {
index: function (request, reply) {
reply([{ name: 'plugin1' }]);
}
}
}
}, next);
};
```