<commit_before>var http = require('http'),
    fs = require('fs'),
    qs = require('querystring'),
    calendar = require('./scripts/kalendar');

var PORT = 3000;

var server = http.createServer(function(req, res){
  res.setEncoding = 'utf8';
  if(req.method == 'GET' && req.url == '/'){
    serve(__dirname + '/index.html', 'text/html')
  } else if (req.method == 'GET' && req.url.substr(-3) == 'css'){
    serve(__dirname + '/' + req.url, 'text/css');
  } else if (req.method == 'GET' && req.url.substr(-2) == 'js'){
    serve(__dirname + '/' + req.url, 'text/javascript');
  } else if (req.method == 'POST' && req.url == '/date_property') {
    var body = '';
    req.on('data', function(chunk) {
      body += chunk;
    });
    req.on('end', function() {
      var day = qs.parse(body).date;
      var daytype = JSON.stringify(calendar.bali_calendar(day));
      res.writeHead(200, {
        'Content-Type': 'application/json',
        'Content-Length': daytype.length.toString()
      });
      res.end(daytype);
    });
  } else {
    console.log(req.url);
    notFound();
  }
  function serve(path, type){
    res.writeHead(200, { 'Content-Type': type });
    fs.createReadStream(path).pipe(res);
  }
  function notFound() {
    res.writeHead(404);
    res.end('Not Found');
  }
});

server.listen(PORT);
<commit_msg>fix port<commit_after>var http = require('http'),
    fs = require('fs'),
    qs = require('querystring'),
    calendar = require('./scripts/kalendar');

var PORT = process.env.PORT || 3000;

var server = http.createServer(function(req, res){
  res.setEncoding = 'utf8';
  if(req.method == 'GET' && req.url == '/'){
    serve(__dirname + '/index.html', 'text/html')
  } else if (req.method == 'GET' && req.url.substr(-3) == 'css'){
    serve(__dirname + '/' + req.url, 'text/css');
  } else if (req.method == 'GET' && req.url.substr(-2) == 'js'){
    serve(__dirname + '/' + req.url, 'text/javascript');
  } else if (req.method == 'POST' && req.url == '/date_property') {
    var body = '';
    req.on('data', function(chunk) {
      body += chunk;
    });
    req.on('end', function() {
      var day = qs.parse(body).date;
      var daytype = JSON.stringify(calendar.bali_calendar(day));
      res.writeHead(200, {
        'Content-Type': 'application/json',
        'Content-Length': daytype.length.toString()
      });
      res.end(daytype);
    });
  } else {
    console.log(req.url);
    notFound();
  }
  function serve(path, type){
    res.writeHead(200, { 'Content-Type': type });
    fs.createReadStream(path).pipe(res);
  }
  function notFound() {
    res.writeHead(404);
    res.end('Not Found');
  }
});

server.listen(PORT);

{'fraction_non_alphanumeric': 0.21072365954255717, 'fraction_numerical': 0.011998500187476566, 'mean_word_length': 3.006006006006006, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5129979', 'n_tokens_mistral': 940, 'n_tokens_neox': 915, 'n_words': 170}