<commit_before>'use strict';
var express = require('express')
  , M       = express()
  , fs      = require('fs')
  , async   = require('async')
  , path    = require('path')
  , hosts   = require('magic-hosts')
  , log     = require('magic-log')
  , db      = require('magic-db')
  , auth    = require('magic-auth')
  , users   = require('magic-users')
  , magic   = {}
  , env     = ( M.get('env') || 'production' )
  , cwd     = process.cwd()
  , config  = require( path.join(cwd, 'config') )
  , conf    = config.defaults[env] || false
;

magic.spawn = function(cb) {
  //default env is production
  M.set('env', env );

  M.set('port', ( process.env.PORT || 5000) );

  M.set('dirs', {
    'hosts' : path.join( cwd, 'hosts' )
  } );

  if ( conf && conf.db ) {
    M.use( function(req, res, next) {
      db(conf.db, function (err, mongoose) {
        if ( err ) { log.error(err); }

        if ( mongoose ) {
          //creates the user database models
          users.init(mongoose);
          auth.init(mongoose);
          M.set('mongoose', mongoose);
        }
        next();
      });
    });
  }
  log('M spawned, env = ' + M.get('env'));
  cb(null, M);
}

magic.autoload = function (M, cb) {  
  log('autoload mounts');
  hosts.mount(M, function (err, results) {
    cb(err, M);<commit_msg>removed db for now<commit_after>'use strict';
var express = require('express')
  , M       = express()
  , fs      = require('fs')
  , async   = require('async')
  , path    = require('path')
  , hosts   = require('magic-hosts')
  , log     = require('magic-log')
  //~ , db      = require('magic-db')
  , auth    = require('magic-auth')
  , users   = require('magic-users')
  , magic   = {}
  , env     = ( M.get('env') || 'production' )
  , cwd     = process.cwd()
  , config  = require( path.join(cwd, 'config') )
  , conf    = config.defaults[env] || false
;

magic.spawn = function(cb) {
  //default env is production
  M.set('env', env );

  M.set('port', ( process.env.PORT || 5000) );

  M.set('dirs', {
    'hosts' : path.join( cwd, 'hosts' )
  } );

  //~ if ( conf && conf.db ) {
    //~ M.use( function(req, res, next) {
      //~ db(conf.dbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, function (err, mongoose) {
        //~ if ( err ) { log.error(err); }
//~ 
        //~ if ( mongoose ) {
          //~ //creates the user database models
          //~ users.init(mongoose);
          //~ auth.init(mongoose);
          //~ M.set('mongoose', mongoose);
        //~ }
        //~ next();
      //~ });
    //~ });
  //~ }
  log('M spawned, env = ' + M.get('env'));
  cb(null, M);
}

magic.autoload = function (M, cb) {  
  log('autoload mounts');
  hosts.mount(M, function (err, results) {
    cb(err, M);
{'fraction_non_alphanumeric': 0.19949403686302855, 'fraction_numerical': 0.0028912179255511385, 'mean_word_length': 2.248826291079812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '1226436', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1018, 'n_words': 194}