<commit_before>var express = require('express');
var _ = require('lodash');
var bodyParser = require('body-parser');
var morgan = require('morgan');

var config = require('./config');
var twilio = require('./twilio');
var middlewares = require('./middlewares');
var routes = require('./routes');

var app = express();

app.use(morgan('combined'));
app.use(bodyParser.json())

app.get('/', function(req, res) {
	res.send('hello world');
});

routes(app);


module.exports = {
	start: function () {
		var server = app.listen(config.port, function () {
			var host = server.address().address;
			var port = server.address().port;
			console.log('Listening at http://%s:%s', host, port);
		});
	}
}<commit_msg>Log error<commit_after>var express = require('express');
var _ = require('lodash');
var bodyParser = require('body-parser');
var morgan = require('morgan');

var config = require('./config');
var twilio = require('./twilio');
var middlewares = require('./middlewares');
var routes = require('./routes');

var app = express();

app.use(morgan('combined'));
app.use(bodyParser.json())

app.get('/', function(req, res) {
	res.send('hello world');
});

routes(app);

app.use(function(error, req, res, next) {
	console.log("Error:", error.stack || error.message || error);
	res.status(500).send({
		error: error.message || error
	});
})

module.exports = {
	start: function () {
		var server = app.listen(config.port, function () {
			var host = server.address().address;
			var port = server.address().port;
			console.log('Listening at http://%s:%s', host, port);
		});
	}
}
{'fraction_non_alphanumeric': 0.20862396956246038, 'fraction_numerical': 0.0019023462270133164, 'mean_word_length': 4.676258992805756, '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': '2519274', 'n_tokens_mistral': 531, 'n_tokens_neox': 511, 'n_words': 117}