<commit_before>var
  _       = require('lodash'),
  express = require('express'),
  fs      = require('fs'),
  http    = require('http'),
  mkdirp  = require('mkdirp'),
  path    = require('path'),
  request = require('request'),
  url     = require('url'),

  port    = 8080
;

var folders = {
  articles: './../content/articles',
  config:   './../content/config',
  media:    './../content/media',
  metadata: './../content/metadata'
};

// Ensure the required folders exist.
Object.keys(folders).forEach(function(folder) {
  mkdirp(folders[folder], function(){});
});

var modules = {
  article: require('./modules/article.js'),
  config:  require('./modules/config.js'),
  media:   require('./modules/media.js'),
  search:  require('./modules/search.js')
};

var app = express();
app.use('/api/w', modules.article);
app.use('/api/config', modules.config);
app.use('/api/search', modules.search);
app.use('/media', modules.media);

_.forEach(['js', 'font', 'images', 'styles'], function(el) {
  app.use('/' + el, express.static(path.join(__dirname, '../build/develop/' + el)));
});

app.get('*', function (req, res) {
  fs.createReadStream(path.join(__dirname, '../build/develop', 'index.html'))
    .pipe(res);
});

http.createServer(app).listen(port, function() {
  console.log('Express server running on port ' + port);
});<commit_msg>Content directories are forced to be relative<commit_after>var
  _       = require('lodash'),
  express = require('express'),
  fs      = require('fs'),
  http    = require('http'),
  mkdirp  = require('mkdirp'),
  path    = require('path'),
  request = require('request'),
  url     = require('url'),

  port    = 8080
;

var folders = {
  articles: path.join(__dirname, '../content/articles'),
  config:   path.join(__dirname, '../content/config'),
  media:    path.join(__dirname, '../content/media'),
  metadata: path.join(__dirname, '../content/metadata')
};

// Ensure the required folders exist.
Object.keys(folders).forEach(function(folder) {
  mkdirp(folders[folder], function(){});
});

var modules = {
  article: require('./modules/article.js'),
  config:  require('./modules/config.js'),
  media:   require('./modules/media.js'),
  search:  require('./modules/search.js')
};

var app = express();
app.use('/api/w', modules.article);
app.use('/api/config', modules.config);
app.use('/api/search', modules.search);
app.use('/media', modules.media);

_.forEach(['js', 'font', 'images', 'styles'], function(el) {
  app.use('/' + el, express.static(path.join(__dirname, '../build/develop/' + el)));
});

app.get('*', function (req, res) {
  fs.createReadStream(path.join(__dirname, '../build/develop', 'index.html'))
    .pipe(res);
});

http.createServer(app).listen(port, function() {
  console.log('Express server running on port ' + port);
});
{'fraction_non_alphanumeric': 0.21354526606772634, 'fraction_numerical': 0.0027643400138217, 'mean_word_length': 3.314456035767511, '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': '3169378', 'n_tokens_mistral': 957, 'n_tokens_neox': 910, 'n_words': 176}