<commit_before>const express = require('express');
const path = require('path');
const app = express();

var allowCrossDomain = function(req, res, next) {
    if ('OPTIONS' == req.method) {
      res.header('Access-Control-Allow-Origin', '*');
      res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,PATCH,OPTIONS');
      res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, Content-Length, X-Requested-With');
      res.send(200);
    }
    else {
      next();
    }
};

app.use(allowCrossDomain);
app.use(express.static(path.join(__dirname,'..', 'build')));

app.get('/', function (req, res) {
  res.json({msg: 'This is CORS-enabled for all origins!'})
  res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
module.exports = app;
<commit_msg>routes are broken in the server<commit_after>const express = require('express');
const path = require('path');
const app = express();
var cors = require('cors')

var allowCrossDomain = function(req, res, next) {
    if ('OPTIONS' == req.method) {
      res.header('Access-Control-Allow-Origin', '*');
      res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,PATCH,OPTIONS');
      res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, Content-Length, X-Requested-With');
      res.send(200);
    }
    else {
      next();
    }
};

app.use(allowCrossDomain);
app.use(express.static(path.join(__dirname,'..', 'build')));

app.get('/', cors(), function (req, res) {
  res.json({msg: 'This is CORS-enabled for all origins!'})
  res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
app.post('/', cors(), function(req, res, next){
  res.json({msg: "this is cors enabled?"})
  res.sendFile(path.join(__dirname, 'build', 'index.html'))
})
module.exports = app;

{'fraction_non_alphanumeric': 0.20033575825405708, 'fraction_numerical': 0.003357582540570789, 'mean_word_length': 4.434650455927052, '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': '53179', 'n_tokens_mistral': 593, 'n_tokens_neox': 587, 'n_words': 116}