Allow different ports for http_simple.js

This commit is contained in:
Ryan Dahl 2010-05-02 17:26:18 -07:00
parent 5457eae28c
commit 99984772df

View File

@ -1,5 +1,7 @@
path = require("path");
port = parseInt(process.env.PORT || 8000);
var puts = require("sys").puts;
var old = (process.argv[2] == 'old');
@ -61,4 +63,6 @@ http.createServer(function (req, res) {
} else {
res.end(body, 'ascii');
}
}).listen(8000);
}).listen(port);
puts('Listening at http://127.0.0.1:'+port+'/');