summaryrefslogtreecommitdiffstats
path: root/index.js
diff options
context:
space:
mode:
authorokalintu <ilkka.oks4nen@gmail.com>2015-03-10 02:17:06 +0200
committerokalintu <ilkka.oks4nen@gmail.com>2015-03-10 02:17:06 +0200
commit2b770c6c85225de5f5e1f85cca65cf83f2de7299 (patch)
tree88fd8a73b52a05a3601a71ddf7808fe26ca7edae /index.js
parentf5e82d12e4e5cf2959a38b73271abc2eab434519 (diff)
port used can now be specified as cmdline parameter
Diffstat (limited to 'index.js')
-rw-r--r--index.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/index.js b/index.js
index 04f62fb..6462631 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,12 @@
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
+var port = 1337;
+
+//get port from commandline parameteres
+if (process.argv.length== 3){
+ port = process.argv[2];
+}
var que = [];
var pws = {};
@@ -66,7 +72,7 @@ function getTimeString()
function log(msg){
console.log(getTimeString()+": "+msg);
}
-
-http.listen(80, function(){
- log('listening on *:80');
+log(port);
+http.listen(port, function(){
+ log('listening on port '+port);
});