<commit_before>'use strict';
var async = require('async');
var cluster = require('cluster');

var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.raw({limit: 100000000}));

var config = require('./lib/config');
var storageService = require('./lib/services/storage');
var workerService = require('./lib/services/worker');
var p2pService = require('./lib/services/p2p');
var embeddedNodeService = require('./lib/services/embeddedNode');

async.series([
  storageService.start.bind(storageService),
  workerService.start.bind(workerService),
  p2pService.start.bind(p2pService),
  embeddedNodeService.start.bind(embeddedNodeService)
], function(){
  if(cluster.isWorker) {
    var router = require('./lib/routes');
    app.use(router);
    var server = app.listen(config.port, function() {
      console.log('api server listening on port 3000!');
    });
    server.timeout = 600000;
  }
});

<commit_msg>api base route<commit_after>'use strict';
var async = require('async');
var cluster = require('cluster');

var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.raw({limit: 100000000}));
// app.use('/', express.static('./node_modules/insight-ui/public'));

var config = require('./lib/config');
var storageService = require('./lib/services/storage');
var workerService = require('./lib/services/worker');
var p2pService = require('./lib/services/p2p');
var embeddedNodeService = require('./lib/services/embeddedNode');

async.series([
  storageService.start.bind(storageService),
  workerService.start.bind(workerService),
  p2pService.start.bind(p2pService),
  embeddedNodeService.start.bind(embeddedNodeService)
], function(){
  if(cluster.isWorker) {
    var router = require('./lib/routes');
    app.use('/api', router);
    var server = app.listen(config.port, function() {
      console.log('api server listening on port 3000!');
    });
    server.timeout = 600000;
  }
});


{'fraction_non_alphanumeric': 0.17635658914728683, 'fraction_numerical': 0.022286821705426358, 'mean_word_length': 5.073529411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '5669422', 'n_tokens_mistral': 645, 'n_tokens_neox': 607, 'n_words': 121}