<commit_before>var sys = require('sys');
var static = require('node-static');

//
// Create a node-static server to serve the current directory
//
var file = new(static.Server)('bin', { cache: false, headers: {'X-Hello':'World!'} });

require('http').createServer(function (request, response) {
  request.addListener('end', function () {
    file.serve(request, response, function (err, res) {
      if (err) {
        sys.error("> Error serving " + request.url + " - " + err.message);
        response.writeHead(err.status, err.headers);
        response.end();
      } else {
        sys.puts("> " + request.url + " - " + res.message);
      }
    });
  });
}).listen(8080);

sys.puts("> node-static is listening on http://127.0.0.1:8080");<commit_msg>add --production flag to server.js<commit_after>var sys = require('sys');
var static = require('node-static');

// resolve debug or production path
var path = 'src';

var args = process.argv;
if (args.length >= 3 && args[2] == '--production') {
  path = 'bin';
}

var file = new(static.Server)(path, { cache: false, headers: {'X-Hello':'World!'} });

require('http').createServer(function (request, response) {
  request.addListener('end', function () {
    file.serve(request, response, function (err, res) {
      if (err) {
        sys.error("> Error serving " + request.url + " - " + err.message);
        response.writeHead(err.status, err.headers);
        response.end();
      } else {
        sys.puts("> " + request.url + " - " + res.message);
      }
    });
  });
}).listen(8080);

sys.puts("> node-static is listening on http://127.0.0.1:8080");
sys.puts("> and serving path: /" + path);
{'fraction_non_alphanumeric': 0.19830713422007254, 'fraction_numerical': 0.018137847642079808, 'mean_word_length': 3.1478696741854635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7091718', 'n_tokens_mistral': 549, 'n_tokens_neox': 529, 'n_words': 123}