<commit_before>require("babel/register");

var koa = require('koa');
var route = require('koa-route');
var serve = require('koa-static');
var mount = require('koa-mount');
var React = require('react');
var _ = require('lodash');
var fs = require('fs');
 
var baseTemplate = fs.readFileSync('./baseTemplate.html');
var ClientApp = require('./jsx/index.jsx');

var app = koa();

app.use(mount('/fa', serve('../node_modules/font-awesome')));
app.use(mount('/public', serve('./public')));

app.use(route.get('/', function *() {
  console.log('rendering');
  var rendered = React.renderToString(React.createElement(ClientApp));
  this.body = _.template(baseTemplate)({body:rendered});
}));

app.listen(3000);<commit_msg>added uncached<commit_after>require("babel/register");

var koa = require('koa');
var route = require('koa-route');
var serve = require('koa-static');
var mount = require('koa-mount');
var React = require('react');
var _ = require('lodash');
var fs = require('fs');
 
var baseTemplate = fs.readFileSync('./baseTemplate.html');
var ClientApp = require('./jsx/index.jsx');

var app = koa();

app.use(mount('/fa', serve('../node_modules/font-awesome')));
app.use(mount('/public', serve('./public')));

app.use(route.get('/', function *() {
  var ClientApp = requireUncached('./jsx/index.jsx'); // dont do this in production. I just want to be able to show changes. 
  var rendered = React.renderToString(React.createElement(ClientApp));
  this.body = _.template(baseTemplate)({body:rendered});
}));

app.listen(3000);

function requireUncached(module){
    delete require.cache[require.resolve(module)]
    return require(module)
}
{'fraction_non_alphanumeric': 0.20450395617772368, 'fraction_numerical': 0.004869141813755326, 'mean_word_length': 5.523809523809524, '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': '866773', 'n_tokens_mistral': 533, 'n_tokens_neox': 519, 'n_words': 108}