<commit_before>/* eslint-disable global-require */
import express from 'express';
import { match } from 'react-router';

let routes = require('../app/routes').default;
let renderPage = require('./renderer').default;

const app = express();

if (module.hot) {
  module.hot.accept('../app/routes', () => {
    routes = require('../app/routes').default;
  });
  module.hot.accept('./renderer', () => {
    renderPage = require('./renderer').default;
  });
}

app.get('*', (req, res, next) => {
  // eslint-disable-next-line consistent-return
  match({ routes, location: req.url }, (err, redirectLocation, renderProps) => {
    if (err) {
      return next(err);
    } else if (redirectLocation) {
      return res.redirect(302,
        redirectLocation.pathname + redirectLocation.search);
    } else if (renderProps) {
      return res.send(renderPage(renderProps));
    }
  });
});

app.use((err) => {
  console.log(err);
});

app.listen(3000, () => {
  console.log('App server listening on 301');
});

export default app;<commit_msg>removed return statement in if/else<commit_after>/* eslint-disable global-require */
import express from 'express';
import { match } from 'react-router';

let routes = require('../app/routes').default;
let renderPage = require('./renderer').default;

const app = express();
const port = 3000;

if (module.hot) {
  module.hot.accept('../app/routes', () => {
    routes = require('../app/routes').default;
  });
  module.hot.accept('./renderer', () => {
    renderPage = require('./renderer').default;
  });
}

app.get('*', (req, res, next) => {
  match({ routes, location: req.url }, (err, redirectLocation, renderProps) => {
    if (err) {
      next(err);
    } else if (redirectLocation) {
      res.redirect(302, redirectLocation.pathname + redirectLocation.search);
    } else if (renderProps) {
      res.send(renderPage(renderProps));
    }
  });
});

app.use((err) => {
  console.log(err);
});

app.listen(port, () => {
  console.log(`App server listening on port ${port}`);
});

export default app;
{'fraction_non_alphanumeric': 0.1971554683668465, 'fraction_numerical': 0.008337420304070623, 'mean_word_length': 3.5434298440979957, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5955281', 'n_tokens_mistral': 649, 'n_tokens_neox': 649, 'n_words': 138}