athieriot/grunt-hapi — pull request #6 by kbdaitch (2014-05-16 19:04:04+00:00)
Title: Add ability to specify createServer options

Ran into this issue where I needed to provide different ports. However, it its current form, this grunt plugin doesn't allow customizing the `Hapi` instance. It requires say `index.js` and established it to be the `Hapi` instance.

I think a better way would be expect the required module to be a wrapper around `Hapi.createServer`; that way users can customize more behavior. I kept backward compatibility with providing the server instance itself.

Added tests, however that required fixing multiserver issue as well. The `task/hapi.js` wasn't able to fork 2 servers, only the second one would persist. By moving the running variable to the inner loop, I was able to get around that.