<commit_before>/**
 * Dependencies.
 */
var express = require('express')
  , app = express()
  ;

app.errors = require('./app/lib/errors');
require('./app/lib/express')(app);

/**
 * Models.
 */
var models = require('./app/models');
app.set('models', models);

/**
 * Controllers.
 */
app.set('controllers', require('./app/controllers')(app));

/**
 * Config.
 */
require('./app/lib/config')(app);

/**
 * Routes.
 */
require('./app/controllers/routes')(app);


if (app.set('env') === 'test') {
  return module.exports = app;
}
else {
  /**
   * Sync database.
   */
  models.sequelize.sync()
    .success(start)
    .error(function(err) {
      console.log('Error sync the db:', err);
      process.exit(1);
    });
}

/**
 * Start server.
 */
function start() {
  var port = app.set('port') || 3050;
  var server = app.listen(port, function () {
    var host = server.address().address;
    var port = server.address().port;
    console.log('Assoc API listening at http://%s:%s in %s environment.', host, port, app.set('env'));
  });
}<commit_msg>promise-style<commit_after>/**
 * Dependencies.
 */
var express = require('express')
  , app = express()
  ;

app.errors = require('./app/lib/errors');
require('./app/lib/express')(app);

/**
 * Models.
 */
var models = require('./app/models');
app.set('models', models);

/**
 * Controllers.
 */
app.set('controllers', require('./app/controllers')(app));

/**
 * Config.
 */
require('./app/lib/config')(app);

/**
 * Routes.
 */
require('./app/controllers/routes')(app);


if (app.set('env') === 'test') {
  return module.exports = app;
}
else {
  /**
   * Sync database.
   */
  models.sequelize.sync()
    .then(start)
    .catch(function(err) {
      console.log('Error sync the db:', err);
      process.exit(1);
    });
}

/**
 * Start server.
 */
function start() {
  var port = app.set('port') || 3060;
  var server = app.listen(port, function () {
    var host = server.address().address;
    var port = server.address().port;
    console.log('Assoc API listening at http://%s:%s in %s environment.', host, port, app.set('env'));
  });
}
{'fraction_non_alphanumeric': 0.2305489260143198, 'fraction_numerical': 0.00477326968973747, 'mean_word_length': 3.077821011673152, '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': '578496', 'n_tokens_mistral': 734, 'n_tokens_neox': 724, 'n_words': 140}