<commit_before>'use strict';

const express = require('express')
const bodyParser = require('body-parser');
const routes = require('./routes')
const cors = require('cors')
const app = express()

app.use(cors())

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

app.use('/api/v1/', routes);

//catch 404 errors
app.use( (req, res, next) => {
  let err = new Error('Not Found');
  err.status = 404;
  next(err)
})<commit_msg>app js built<commit_after>'use strict';

const express = require('express')
const bodyParser = require('body-parser');
const routes = require('./routes')
const cors = require('cors')
const app = express()

app.use(cors())

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

app.use('/api/v1/', routes);

//catch 404 errors
app.use( (req, res, next) => {
  let err = new Error('Not Found');
  err.status = 404;
  next(err)
})

//user error
app.use((err, req, res, next)=> {
  res.status(err.status || 500);
  res.json({
    message: err.message,
    error: {}
  })
})

const port = process.env.PORT || 3000;
app.list(port, ()=>{
  console.log(process.evn.NODE_ENV)
  console.log(`Listening on port ${port}`)
});
module.exports = app;
{'fraction_non_alphanumeric': 0.19735755573905864, 'fraction_numerical': 0.017341040462427744, 'mean_word_length': 4.509090909090909, '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': '4281986', 'n_tokens_mistral': 443, 'n_tokens_neox': 423, 'n_words': 102}