<commit_before>import { Router } from 'express';
import { match } from 'react-router';
import createHistory from 'history/lib/createMemoryHistory';
import createRoutes from '../../common/routes';
import createPage from './page';

const router = Router();

router.use((req, res) => {

  const history = createHistory();
  const routes = createRoutes(history);
  const location = history.createLocation(req.url);

  match({routes, location}, (error, redirectLocation, renderProps) => {

    if (error) {
      res.status(500).send(error.message);
    }

    if (redirectLocation) {
      res.rediect(302, redirectLocation.pathname + redirectLocation.search);
    }

    if (renderProps) {
      res.status(200).end(createPage(renderProps));
    } else {
      res.staus(404).send('Not Found');
    }
  });

});
<commit_msg>fix typo in server codes<commit_after>import { Router } from 'express';
import { match } from 'react-router';
import createHistory from 'history/lib/createMemoryHistory';
import createRoutes from '../../common/routes';
import createPage from './page';

const router = Router();

router.use((req, res) => {

  const history = createHistory();
  const routes = createRoutes(history);
  const location = history.createLocation(req.url);

  match({routes, location}, (error, redirectLocation, renderProps) => {

    if (error) {
      res.status(500).send(error.message);
    }

    if (redirectLocation) {
      res.redirect(302, redirectLocation.pathname + redirectLocation.search);
    }

    if (renderProps) {
      res.status(200).end(createPage(renderProps));
    } else {
      res.status(404).send('Not Found');
    }
  });

});

{'fraction_non_alphanumeric': 0.15226586102719034, 'fraction_numerical': 0.014501510574018127, 'mean_word_length': 3.7723342939481266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7277855', 'n_tokens_mistral': 513, 'n_tokens_neox': 492, 'n_words': 110}