<commit_before>'use strict';

const port = process.env.PORT || app.get('port');
const path = require('path');
const serveStatic = require('feathers').static;
const compress = require('compression');
const cors = require('cors');
const feathers = require('feathers');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
const socketio = require('feathers-socketio');
const handler = require('feathers-errors/handler');
const bodyParser = require('body-parser');
var MongoClient = require('mongodb').MongoClient;
const service = require('feathers-mongodb');
const favicon = require('serve-favicon');

var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;

if (!databaseUri) {
  console.log('DATABASE_URI not specified, falling back to localhost.');
}


// Create a feathers instance.
const app = feathers()
  // Enable Socket.io
  .configure(socketio())
  // Enable REST services
  .configure(rest())
  //turn on CORS for fun
  .options('*', cors())
  .use(cors())
  // Turn on JSON parser for REST services
  .use(bodyParser.json())
  // Turn on URL-encoded parser for REST services
  .use(bodyParser.urlencoded({extended: true}))
  // favico
  .use(favicon( path.join(app.get('public'), 'favicon.ico') ))
  // Serve static files
  .use('/', serveStatic( app.get('public') ));


const promise = new Promise(function(resolve) {
  // Connect to your MongoDB instance(s)
  MongoClient.connect(databaseUri || 'mongodb://localhost:27017/dev').then(function(db){
    // Connect to the db, create and register a Feathers service.
    app.use('/messages', service({<commit_msg>fixed issue?<commit_after>'use strict';

const port = process.env.PORT || 3030
const path = require('path');
const serveStatic = require('feathers').static;
const compress = require('compression');
const cors = require('cors');
const feathers = require('feathers');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
const socketio = require('feathers-socketio');
const handler = require('feathers-errors/handler');
const bodyParser = require('body-parser');
var MongoClient = require('mongodb').MongoClient;
const service = require('feathers-mongodb');
const favicon = require('serve-favicon');

var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;

if (!databaseUri) {
  console.log('DATABASE_URI not specified, falling back to localhost.');
}


// Create a feathers instance.
const app = feathers()
  // Enable Socket.io
  .configure(socketio())
  // add files
  .configure(configuration(path.join(__dirname, '..')))
  // Enable REST services
  .configure(rest())
  //turn on CORS for fun
  .options('*', cors())
  .use(cors())
  // Turn on JSON parser for REST services
  .use(bodyParser.json())
  // Turn on URL-encoded parser for REST services
  .use(bodyParser.urlencoded({extended: true}));
  // favico
  app.use(favicon( path.join(app.get('public'), 'favicon.ico') ))
  // Serve static files
  .use('/', serveStatic( app.get('public') ));


const promise = new Promise(function(resolve) {
  // Connect to your MongoDB instance(s)
  MongoClient.connect(databaseUri || 'mongodb://localhost:27017/dev').then(function(db){
    // Connect to the db, create and register a Feathers service.
    app.use('/messages', service({
{'fraction_non_alphanumeric': 0.15967153284671534, 'fraction_numerical': 0.004257907542579075, 'mean_word_length': 4.729965156794425, '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': '1489776', 'n_tokens_mistral': 1026, 'n_tokens_neox': 998, 'n_words': 263}