<commit_before>var express = require('express');
var habitat = require('habitat');
var path = require('path');
var fs = require('fs');

habitat.load();

var env = habitat();
var app = express();

app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "X-Requested-With");
  next();
});

app.use('/assets', express.static(path.join(__dirname, 'components')));
app.use('/components', express.static(path.join(__dirname, 'components')));

app.use(express.bodyParser());
app.use(express.logger());

app.get('/package/:components', function (req, res) {
  var components = req.params.components.split('+');

  function collectAndSendComponentData () {
    var packagedData = '';
    if (components.length) {
      var todo = components.length;
      components.forEach(function (name) {
        var componentPath = path.join(__dirname, 'components', name);
        fs.readFile(componentPath, 'utf-8', function (err, data) {
          if (!err) {
            packagedData += '\n' + data;
          }
          if (--todo === 0) {<commit_msg>Properly serving assets.<commit_after>var express = require('express');
var habitat = require('habitat');
var path = require('path');
var fs = require('fs');

habitat.load();

var env = habitat();
var app = express();

app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "X-Requested-With");
  next();
});

app.use('/assets', express.static(path.join(__dirname, 'assets')));
app.use('/components', express.static(path.join(__dirname, 'components')));

app.use(express.bodyParser());
app.use(express.logger());

app.get('/package/:components', function (req, res) {
  var components = req.params.components.split('+');

  function collectAndSendComponentData () {
    var packagedData = '';
    if (components.length) {
      var todo = components.length;
      components.forEach(function (name) {
        var componentPath = path.join(__dirname, 'components', name);
        fs.readFile(componentPath, 'utf-8', function (err, data) {
          if (!err) {
            packagedData += '\n' + data;
          }
          if (--todo === 0) {
{'fraction_non_alphanumeric': 0.18724741805118994, 'fraction_numerical': 0.001796138302649304, 'mean_word_length': 3.8225108225108224, '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': '2386388', 'n_tokens_mistral': 675, 'n_tokens_neox': 670, 'n_words': 142}