text: 'use strict';
  /**
   * Module dependencies.
   */
  var init = require('./config/init')(),
      config = require('./config/config'),
      mongoose = require('mongoose'),
      chalk = require('chalk'),
      app;
  
  /**
   * Main application entry file.
   * Please note that the order of loading is important.
   */
  
  // Bootstrap db connection
  var db = mongoose.connect(config.db, function(err) {
      if (err) {
          console.error(chalk.red('Could not connect to MongoDB!'));
          console.log(chalk.red(err));
      } else {
          // Start the app by listening on <port>
          app.listen(config.port);
      }
  });
  
  // Init the express application
  app = require('./config/express')(db);
  
  // Bootstrap passport config
  require('./config/passport')();
  
  // Expose app
  exports = module.exports = app;
  
  // Logging initialization
  console.log('MEAN.JS application started on port ' + config.port);
  