iriscouch/dnsd — pull request #10 by KrishnaSwathi (2014-08-21 11:21:52+00:00)
Title: Make createServer API be consistent with httpServer on node core

I was trying to use `dnsd` like I normally call my http node server:

``` javascript
var dnsd = require('dnsd'),
port = 3737

dnsd.createServer(function (req, res) {
res.end('1.2.3.4')
}).listen(port, function () {
console.log('started on %s', port)
})
```

`dnsd` was wrongfully using the callback function as the ip, which caused side effects.

This patch prevents this behavior and re-introduces the same api as node http create server.

I couldn't find how to add tests and documentation for this change, but will provide them at your request