<commit_before>var http = require('http');
var router = require('http-router');
var routes = router.createRouter();
var url = require('url');
var handlers = require('./handlers');

routes
    .get('/', function (req, res, next) {
        return next();
    })
    .post('/', function (req, res, next) {
        // TODO: check signatures
        var body = '';
        req.on('data', function(chunk) {
            console.log('ondata', chunk);
            body += chunk;
        });
        req.on('end', function() {            
            var data = JSON.parse(body);<commit_msg>JSON parse of chank data<commit_after>var http = require('http');
var router = require('http-router');
var routes = router.createRouter();
var url = require('url');
var handlers = require('./handlers');

routes
    .get('/', function (req, res, next) {
        return next();
    })
    .post('/', function (req, res, next) {
        // TODO: check signatures
        var body = '';
        req.on('data', function(chunk) {
            console.log('ondata', JSON.parse(chunk));
            body += chunk;
        });
        req.on('end', function() {            
            var data = JSON.parse(body);
{'fraction_non_alphanumeric': 0.17637130801687764, 'fraction_numerical': 0.0, 'mean_word_length': 2.2054054054054055, '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': '429244', 'n_tokens_mistral': 336, 'n_tokens_neox': 333, 'n_words': 91}