<commit_before>const path = require('path');
const express = require('express');
const volleyball = require('volleyball');
const routes = require('./routes.js');
const bodyParser = require('body-parser');
const session = require('express-session');


//express Variables
const app = express();
const PORT = process.env.PORT || 3000;

//static serving middleware
app.use(express.static(path.join(__dirname, '../public')));

//body parsing middleware
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

//session middleware
app.use(session({
  secret: 'a wildly insecure secret',
  resave: false,
  saveUninitialized: false
}));

// logging middleware:
app.use(volleyball);

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


app.listen(PORT, () => {
  console.log('Server listening on port: ', PORT);
});

//Error handling middleware
app.use((err, req, res, next) =>  {
  console.error(err);
  console.error(err.stack);
  res.status(err.status || 500).send(err.message || 'Internal Server Error');
});

//Sends index.html file to client on all get requests
app.get('*', (req, res, next) => {
  res.sendFile(path.join(__dirname, '../public/index.html'));
});<commit_msg>removes extraneous comments in server code<commit_after>const path = require('path');
const express = require('express');
const volleyball = require('volleyball');
const routes = require('./routes.js');
const bodyParser = require('body-parser');
const session = require('express-session');

const app = express();
const PORT = process.env.PORT || 3000;

app.use(express.static(path.join(__dirname, '../public')));

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

app.use(session({
  secret: 'a wildly insecure secret',
  resave: false,
  saveUninitialized: false
}));

app.use(volleyball);

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

app.listen(PORT, () => {
  console.log('Server listening on port: ', PORT);
});

app.use((err, req, res, next) =>  {
  console.error(err);
  console.error(err.stack);
  res.status(err.status || 500).send(err.message || 'Internal Server Error');
});

//Sends index.html file to client on all get requests
app.get('*', (req, res, next) => {
  res.sendFile(path.join(__dirname, '../public/index.html'));
});
{'fraction_non_alphanumeric': 0.1895395619132767, 'fraction_numerical': 0.006258381761287439, 'mean_word_length': 5.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3659048', 'n_tokens_mistral': 719, 'n_tokens_neox': 701, 'n_words': 173}