<commit_before>import bodyParser from 'body-parser';
import compression from 'compression';
import errorHandler from 'errorhandler';
import express from 'express';
import expressReactViews from 'express-react-views';
import expressValidator from 'express-validator';
import path from 'path';
import config from './server';

const ONE_YEAR = 31557600000;
const NODE_ENV = process.env.NODE_ENV;

const app = express();

if (NODE_ENV === 'development') {
  const compiler = require('webpack')(config.webpackConfig);
  app.use(require('webpack-dev-middleware')(compiler, { noInfo: true, publicPath: config.publicPath }));
  app.use(require('webpack-hot-middleware')(compiler));
}
app.set('views', path.resolve(__dirname, '../view'));
app.set('view engine', 'jsx');
app.engine('jsx', expressReactViews.createEngine({
  babel: {
    presets: ['es2015', 'stage-3', 'react'],
    plugins: [
      ['transform-runtime'],
      ['transform-class-properties', { spec: true }],
      ['transform-es2015-classes'],
    ],
  },
}));
app.use(compression({
  level: 9,
  threshold: 0,
  filter: () => true,
}));
app.use(bodyParser.json({ limit: '1mb' }));
app.use(bodyParser.urlencoded({ limit: '1mb', extended: true }));
app.use(expressValidator());<commit_msg>beautify static markup if in development.<commit_after>import bodyParser from 'body-parser';
import compression from 'compression';
import errorHandler from 'errorhandler';
import express from 'express';
import expressReactViews from 'express-react-views';
import expressValidator from 'express-validator';
import path from 'path';
import config from './server';

const ONE_YEAR = 31557600000;
const NODE_ENV = process.env.NODE_ENV;

const app = express();

if (NODE_ENV === 'development') {
  const compiler = require('webpack')(config.webpackConfig);
  app.use(require('webpack-dev-middleware')(compiler, { noInfo: true, publicPath: config.publicPath }));
  app.use(require('webpack-hot-middleware')(compiler));
}
app.set('views', path.resolve(__dirname, '../view'));
app.set('view engine', 'jsx');
app.engine('jsx', expressReactViews.createEngine({
  beautify: NODE_ENV === 'development',
  babel: {
    presets: ['es2015', 'stage-3', 'react'],
    plugins: [
      ['transform-runtime'],
      ['transform-class-properties', { spec: true }],
      ['transform-es2015-classes'],
    ],
  },
}));
app.use(compression({
  level: 9,
  threshold: 0,
  filter: () => true,
}));
app.use(bodyParser.json({ limit: '1mb' }));
app.use(bodyParser.urlencoded({ limit: '1mb', extended: true }));
app.use(expressValidator());
{'fraction_non_alphanumeric': 0.178125, 'fraction_numerical': 0.01875, 'mean_word_length': 5.4185463659147866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7364128', 'n_tokens_mistral': 819, 'n_tokens_neox': 791, 'n_words': 183}