<commit_before>'use strict';

let express = require('express');
let user = require('./controllers/user');
let bodyParser = require('body-parser');
let jwtMiddleware = require('./config/security');
let corsMiddleware = require('./config/cors');
let mongoose = require('mongoose');
let config = require('./config');
let log4js = require('log4js');
let logzio = require('./config/logzio-logging');

function init () {
  let app = express();
  mongoose.connect(config.mongodb.url);
  log4js.configure(config.log4js);
  log4js.addAppender(logzio.appender('QVHxtRWixocpGKEpeuWbKEWcWfsgpQFt'));

  app.use(jwtMiddleware);
  app.use(corsMiddleware);
  app.use(bodyParser.json());

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

  app.use(function uncaughtErrorHandler (err, req, res, next) {
    res.json({ error: { message: err.message } });
    console.error(err);
  });

  let port = config.port;
  app.listen(port, () => console.log(`App listening on port ${port}!`));
}

init ();<commit_msg>Extract separate configuration file and provide its options to all needed to configure components<commit_after>'use strict';

let express = require('express');
let user = require('./controllers/user');
let bodyParser = require('body-parser');
let jwtMiddleware = require('./config/security');
let corsMiddleware = require('./config/cors');
let mongoose = require('mongoose');
let config = require('./config');
let log4js = require('log4js');
let logzio = require('./config/logzio-logging');

function init () {
  let app = express();
  mongoose.connect(config.mongodb.url);
  log4js.configure(config.log4js);
  log4js.addAppender(logzio.appender(config.logzio.key));

  app.use(jwtMiddleware);
  app.use(corsMiddleware);
  app.use(bodyParser.json());

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

  app.use(function uncaughtErrorHandler (err, req, res, next) {
    res.json({ error: { message: err.message } });
    console.error(err);
  });

  let port = config.port;
  app.listen(port, () => console.log(`App listening on port ${port}!`));
}

init ();
{'fraction_non_alphanumeric': 0.17702635504724018, 'fraction_numerical': 0.004972650422675286, 'mean_word_length': 4.988095238095238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4073481', 'n_tokens_mistral': 658, 'n_tokens_neox': 662, 'n_words': 139}