diff --git a/lib/server.js b/lib/server.js index 0c0eacd..811d927 100644 --- a/lib/server.js +++ b/lib/server.js @@ -25,18 +25,16 @@ function createServer(options, callback) { createWatch(app, fn); } - if (callback) { - callback(null, app); - } else { - log.info('server', 'http://127.0.0.1:' + options.port); - app.listen(options.port).on('error', function(e) { - if (e.code === 'EADDRINUSE') { - log.error('error', 'this port is in use, change to another one'); - } else { - throw e; - } - }); - } + log.info('server', 'http://127.0.0.1:' + options.port); + app.listen(options.port).on('error', function(e) { + if (e.code === 'EADDRINUSE') { + log.error('error', 'this port is in use, change to another one'); + } else { + throw e; + } + }); + + callback && callback(null, app); } var io;