<commit_before>(function() {
  'use strict';

  var env = process.env.NODE_ENV || 'development';
  if (env === 'development') {
    require('dotenv').load();
  }

  var database = require('./server/config/database')[env],
    mongoose = require('mongoose'),
    path = require('path'),
    express = require('express'),
    app = require('./server/config/express'),
    initDb =  require('./seeds/user'),
    port = process.env.PORT || 5555;

  // connection to the database;
    mongoose.connect(database.url, function(err) {
    if (err) {
    console.log('Error connecting to the database');
    console.log(err);
  } else {
    console.log('Connected to the database...');
    if (env === 'production' || process.argv[2] === 'initDb' ) {
      mongoose.connection.db.dropDatabase(function(err) {
        if (err) {
          return err;
        } else {
          console.log('Dropped database...');
          console.log('Seeding database...');
          initDb();
        }
      });
    }
  }
 });
  // view engine setup
  app.set('views', path.join(__dirname, 'app/views'));
  app.set('view engine', 'jade');

  // error handlers
  // development error handler
  // will print stacktrace
  if (env === 'development') {
    app.use(function(err, req, res, next) {
      res.status(err.status || 500).send(err.message);
      next();
    });
  }
  app.use(express.static(path.join(__dirname, './public')));
  app.route('/*').get(function (req, res) {
   return res.sendFile(path.join(__dirname, './public/index.html'));
 });

  var server = app.listen(port, function() {
    console.log('Express server listening on %d, in %s' +
      ' mode', server.address().port, app.get('env'));<commit_msg>Heroku build issues Refers to [#114487833] - Update database url<commit_after>(function() {
  'use strict';

  var env = process.env.NODE_ENV || 'development';
  if (env === 'development') {
    require('dotenv').load();
  }

  var database = require('./server/config/database')[env],
    mongoose = require('mongoose'),
    path = require('path'),
    express = require('express'),
    app = require('./server/config/express'),
    initDb =  require('./seeds/user'),

    port = process.env.PORT || 5555;

  // connection to the database;
    console.log(database);
    mongoose.connect(process.env.DATABASE_URL, function(err) {
    if (err) {
    console.log('Error connecting to the database');
    console.log(err);
  } else {
    console.log('Connected to the database...');
    if (env === 'production' || process.argv[2] === 'initDb' ) {
      mongoose.connection.db.dropDatabase(function(err) {
        if (err) {
          return err;
        } else {
          console.log('Dropped database...');
          console.log('Seeding database...');
          initDb();
        }
      });
    }
  }
 });
  // view engine setup
  app.set('views', path.join(__dirname, 'app/views'));
  app.set('view engine', 'jade');

  // error handlers
  // development error handler
  // will print stacktrace
  if (env === 'development') {
    app.use(function(err, req, res, next) {
      res.status(err.status || 500).send(err.message);
      next();
    });
  }
  app.use(express.static(path.join(__dirname, './public')));
  app.route('/*').get(function (req, res) {
   return res.sendFile(path.join(__dirname, './public/index.html'));
 });

  var server = app.listen(port, function() {
    console.log(database);
    console.log('Express server listening on %d, in %s' +
      ' mode', server.address().port, app.get('env'));
{'fraction_non_alphanumeric': 0.18835227272727273, 'fraction_numerical': 0.007102272727272727, 'mean_word_length': 2.8565169769989045, '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': '4162431', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1092, 'n_words': 231}