X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=www%2Fserve-analysis.js;h=40d4f194f0e1b45f557168e0fdeb9185b55039f8;hp=675117ce4acf51275b669f149c56bddba0acce63;hb=bc34229c7767d4c255e6537c7b604ba5bb7a0e28;hpb=f98a82fad222242e29e05b7c59bf69ae29a0d034 diff --git a/www/serve-analysis.js b/www/serve-analysis.js index 675117c..40d4f19 100644 --- a/www/serve-analysis.js +++ b/www/serve-analysis.js @@ -15,6 +15,9 @@ var JSON_FILENAME = '/srv/analysis.sesse.net/www/analysis.json'; var HISTORY_TO_KEEP = 5; var MINIMUM_VERSION = null; +// TCP port to listen on; can be overridden with flags. +var port = 5000; + // If set to 1, we are already processing a JSON update and should not // start a new one. If set to 2, we are _also_ having one in the queue. var json_lock = 0; @@ -297,4 +300,8 @@ server.on('connection', function(socket) { } }); }); -server.listen(5000); + +if (process.argv.length >= 3) { + port = parseInt(process.argv[2]); +} +server.listen(port);