<commit_before>'use strict';

var wsconfig = require('../wsconfig.json')
  , startWsServer = require('./server/wsserver')
  , startHttpServer = require('./server/httpserver');


/**
 * Start the game server.
 *
 * @arg {number} port - Front-end HTTP server port.
 * @arg {number} wsport - Back-end WebSocket server port.
 */
var start = function (port, wsport) {
  startWsServer(wsport);
  startHttpServer(port);

  console.log('Server started at localhost:' + port);
};

start(5001, wsconfig.port);
<commit_msg>Accept HTTP port from the command line<commit_after>'use strict';

var wsconfig = require('../wsconfig.json')
  , startWsServer = require('./server/wsserver')
  , startHttpServer = require('./server/httpserver');


var httpPort = (function (argv) {
  if (argv.length > 1) {
    console.log('Usage:  server.js [<port>]');
    process.exit(1);
  }

  return argv[0] || 5001;
}(process.argv.slice(2)));


/**
 * Start the game server.
 *
 * @arg {number} port - Front-end HTTP server port.
 * @arg {number} wsport - Back-end WebSocket server port.
 */
var start = function (port, wsport) {
  startWsServer(wsport);
  startHttpServer(port);

  console.log('Server started at localhost:' + port);
};

start(httpPort, wsconfig.port);

{'fraction_non_alphanumeric': 0.16532258064516128, 'fraction_numerical': 0.00967741935483871, 'mean_word_length': 3.964, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3661205', 'n_tokens_mistral': 424, 'n_tokens_neox': 397, 'n_words': 103}