From: Steinar H. Gunderson Date: Thu, 25 Jun 2015 20:07:22 +0000 (+0200) Subject: Make serve-analysis.js capable of handling e.g. /analysis2.pl. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=a0290e9de747b7811e8403b6e7ea80ba5d96cd71 Make serve-analysis.js capable of handling e.g. /analysis2.pl. --- diff --git a/www/serve-analysis.js b/www/serve-analysis.js index d69c23a..9bb33cf 100644 --- a/www/serve-analysis.js +++ b/www/serve-analysis.js @@ -20,10 +20,16 @@ if (process.argv.length >= 3) { json_filename = process.argv[2]; } +// Expected destination filename. +var serve_url = '/analysis.pl'; +if (process.argv.length >= 4) { + serve_url = process.argv[3]; +} + // TCP port to listen on. var port = 5000; -if (process.argv.length >= 4) { - port = parseInt(process.argv[3]); +if (process.argv.length >= 5) { + port = parseInt(process.argv[4]); } // If set to 1, we are already processing a JSON update and should not @@ -264,7 +270,7 @@ server.on('request', function(request, response) { handle_viewer_override(request, u, response); return; } - if (u.pathname !== '/analysis.pl') { + if (u.pathname !== serve_url) { // This is not the request you are looking for. send_404(response); return;