Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow for binding to a unix socket.

  • Loading branch information...
commit a12a193b3e166ad8723f3b0c150ac161a8d171d8 1 parent 8f89d58
@creationix authored
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() {
Please sign in to comment.
Something went wrong with that request. Please try again.