<commit_before>var express = require('express');
var bodyParser = require('body-parser');
var http = require('http');
var path = require('path');

var middleware = require('./middleware');
var routes = require('./routes');
var mailer = require('./mailer');

var app = express();

app.set('port', process.env.PORT || 3000);
app.set('mailer', mailer());

app.get('/', function (req, res) {
	res.status(404);
	res.type('html');
	res.send('<p>This is only useful to computers. Documentation available <a href="//billinghamj.github.io/mailer-service/">here</a></p>');
});

app.use(middleware.authorization(app));
app.use(middleware.typeValidation(app));
app.use(bodyParser.json());

routes.setup(app);

app.all('*', function (req, res) {
	res.status(404).end();
});

module.exports = app;

if (require.main === module) {<commit_msg>Added Istanbul ignore for the code which makes the server listen<commit_after>var express = require('express');
var bodyParser = require('body-parser');
var http = require('http');
var path = require('path');

var middleware = require('./middleware');
var routes = require('./routes');
var mailer = require('./mailer');

var app = express();

app.set('port', process.env.PORT || 3000);
app.set('mailer', mailer());

app.get('/', function (req, res) {
	res.status(404);
	res.type('html');
	res.send('<p>This is only useful to computers. Documentation available <a href="//billinghamj.github.io/mailer-service/">here</a></p>');
});

app.use(middleware.authorization(app));
app.use(middleware.typeValidation(app));
app.use(bodyParser.json());

routes.setup(app);

app.all('*', function (req, res) {
	res.status(404).end();
});

module.exports = app;

/* istanbul ignore if : not used during unit testing */
if (require.main === module) {
{'fraction_non_alphanumeric': 0.20840431572969903, 'fraction_numerical': 0.011357183418512209, 'mean_word_length': 5.430656934306569, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1008039', 'n_tokens_mistral': 589, 'n_tokens_neox': 572, 'n_words': 136}