<commit_before>'use strict'; // eslint-disable-line

// make `.jsx` file requirable by node
// TODO: Node-JSX is depreated need to move this to Babel when React Engine supports it.
require('node-jsx').install({ harmony: true });

import express from 'express';
import path from 'path';
import ReactEngine from 'react-engine';
import env from 'node-env-file';

const app = express();
const http = require('http').Server(app);

env('./.env');

const port = process.env.PORT || 9000;

// create the view engine with `react-engine`
let engine = ReactEngine.server.create({
  routes: require(path.join(__dirname, '/public/routes.jsx')),
  routesFilePath: path.join(__dirname, '/public/routes.jsx')
});

// set the engine
app.engine('.jsx', engine);

// set the view directory
app.set('views', path.join(__dirname, '/public/views'));

// set jsx as the view engine
app.set('view engine', 'jsx');

// finally, set the custom view
app.set('view', require('react-engine/lib/expressView'));

//expose public folder as static assets
app.use(express.static( path.join(__dirname, '/public' )));

require('./app/router.js')(app);

http.listen(port, function() {
  console.log('listing on port:' + port); // eslint-disable-line
});<commit_msg>changing to babel and file clean up<commit_after>require('babel/register');

import express from 'express';
import path from 'path';
import ReactEngine from 'react-engine';
import env from 'node-env-file';

const app = express();
const http = require('http').Server(app);

env('./.env');

const port = process.env.PORT || 9000;

const engine = ReactEngine.server.create({
    routes: require(path.join(__dirname, '/public/routes.jsx')),
    routesFilePath: path.join(__dirname, '/public/routes.jsx')
});

app.engine('.jsx', engine);
app.set('views', path.join(__dirname, '/public/views'));
app.set('view engine', 'jsx');
app.set('view', require('react-engine/lib/expressView'));
app.use(express.static( path.join(__dirname, '/public' )));

require('./app/router.js')(app);

http.listen(port, () => {
    console.log('listing on port:' + port);
});
{'fraction_non_alphanumeric': 0.1855421686746988, 'fraction_numerical': 0.0038554216867469878, 'mean_word_length': 4.815126050420168, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3235427', 'n_tokens_mistral': 658, 'n_tokens_neox': 655, 'n_words': 176}