Permalink
Browse files

listen() now accepts a callback, like http.server.listen; whitespace

  • Loading branch information...
1 parent c7c669e commit e355f6364f0a065d97f43f6d1940d1cd608a404f @jdub jdub committed Aug 24, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/node-router.js
View
10 lib/node-router.js
@@ -268,19 +268,19 @@ exports.getServer = function getServer(logger) {
});
- function listen(port, host) {
+ function listen(port, host, callback) {
port = port || 8080;
if (typeof host === 'undefined' || host == '*')
- host = null ;
+ host = null;
+ server.listen(port, host, callback);
- server.listen(port, host);
if (typeof port === 'number') {
- logger("node-router server instance at http://" + host + ":" + port + "/");
+ logger("node-router server instance at http://" + (host || '*') + ":" + port + "/");
} else {
logger("node-router server instance at unix:" + port);
- }
+ }
}
function end() {

0 comments on commit e355f63

Please sign in to comment.