Permalink
Browse files

Allow for binding to a unix socket.

  • Loading branch information...
1 parent 8f89d58 commit a12a193b3e166ad8723f3b0c150ac161a8d171d8 @creationix committed Apr 26, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/node-router.js
View
10 lib/node-router.js
@@ -254,9 +254,15 @@ exports.getServer = function getServer(logger) {
function listen(port, host) {
port = port || 8080;
- host = host || "127.0.0.1";
+ if (typeof port === 'number') {
+ host = host || "127.0.0.1";
+ }
server.listen(port, host);
- logger("node-router server instance at http://" + host + ":" + port + "/");
+ if (typeof port === 'number') {
+ logger("node-router server instance at http://" + host + ":" + port + "/");
+ } else {
+ logger("node-router server instance at unix:" + port);
+ }
}
function end() {

0 comments on commit a12a193

Please sign in to comment.