<commit_before>import Hapi from 'hapi';

import cli from './helpers/cli';
import cliConfig from './config/cli';
import thinky from './helpers/thinky';
import strategies from './config/strategies';
import serverConfig from './config/server';
import plugins from './config/plugins';
import routes from './config/routes';

const server = new Hapi.Server(serverConfig.options);
server.connection(serverConfig.connection);

server.ext('onPreResponse', (request, reply) => {
  if (request.response.source instanceof thinky.Errors.DocumentNotFound) {
    request.response.code(404);
  }

  reply.continue();
});

server.register(plugins, error => {
  if (error) {
    return server.log('error', error);
  }

  strategies.forEach(strategy => {
    server.auth.strategy(strategy.name, strategy.scheme, strategy.mode, strategy.options);
  });

  server.route(routes);

  if (!module.parent) {
    server.start(() => server.log('info', `Server running at: ${server.info.uri}`));
  }
});

if (cliConfig.enabled) {
  cli.listen(cliConfig.port);
}

export default server;<commit_msg>Output 'vantage started on port x' log message<commit_after>import Hapi from 'hapi';

import cli from './helpers/cli';
import cliConfig from './config/cli';
import thinky from './helpers/thinky';
import strategies from './config/strategies';
import serverConfig from './config/server';
import plugins from './config/plugins';
import routes from './config/routes';

const server = new Hapi.Server(serverConfig.options);
server.connection(serverConfig.connection);

server.ext('onPreResponse', (request, reply) => {
  if (request.response.source instanceof thinky.Errors.DocumentNotFound) {
    request.response.code(404);
  }

  reply.continue();
});

server.register(plugins, error => {
  if (error) {
    return server.log('error', error);
  }

  strategies.forEach(strategy => {
    server.auth.strategy(strategy.name, strategy.scheme, strategy.mode, strategy.options);
  });

  server.route(routes);

  if (!module.parent) {
    server.start(() => server.log('info', `Server running at: ${server.info.uri}`));
  }
});

if (cliConfig.enabled) {
  cli.listen(cliConfig.port);
  server.log('info', `Vantage CLI started on port ${cliConfig.port}`);
}

export default server;
{'fraction_non_alphanumeric': 0.16101694915254236, 'fraction_numerical': 0.0026761819803746653, 'mean_word_length': 4.62155388471178, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3251782', 'n_tokens_mistral': 686, 'n_tokens_neox': 684, 'n_words': 159}