<commit_before>'use strict'

const express = require('express')
const methodOverride = require('method-override')
const bodyParser = require('body-parser')
const app = express()


// Server config

app.use(methodOverride('X-HTTP-Method'))
app.use(methodOverride('X-HTTP-Method-Override'))
app.use(methodOverride('X-Method-Override'))
app.use(methodOverride('_method'))

app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))

app.use(function (req, res, next) {
  res.header('Access-Control-Allow-Origin', '*')
  res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')

  let date = new Date()
  console.log(`request at: ${date.toString()}`)
  next()
})


// Routes

app.use('/', require('./routes'))

<commit_msg>allow CORS to get, post, put and delete<commit_after>'use strict'

const express = require('express')
const methodOverride = require('method-override')
const bodyParser = require('body-parser')
const app = express()


// Server config

app.use(methodOverride('X-HTTP-Method'))
app.use(methodOverride('X-HTTP-Method-Override'))
app.use(methodOverride('X-Method-Override'))
app.use(methodOverride('_method'))

app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))

app.use(function (req, res, next) {
  res.header('Access-Control-Allow-Origin', '*')
  res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
  res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE')

  let date = new Date()
  console.log(`request at: ${date.toString()}`)
  next()
})


// Routes

app.use('/', require('./routes'))


{'fraction_non_alphanumeric': 0.1884498480243161, 'fraction_numerical': 0.0, 'mean_word_length': 5.557768924302789, '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': '992635', 'n_tokens_mistral': 535, 'n_tokens_neox': 526, 'n_words': 102}