Files
meanTorrent/server.js

35 lines
882 B
JavaScript
Raw Normal View History

2013-12-25 16:36:33 +02:00
'use strict';
2013-05-22 17:03:50 +03:00
/**
* Module dependencies.
*/
2014-11-10 23:12:33 +02:00
var config = require('./config/config'),
mongoose = require('./config/lib/mongoose'),
2015-07-02 12:08:09 +03:00
express = require('./config/lib/express'),
chalk = require('chalk');
2013-05-22 17:03:50 +03:00
/**
* Main application entry file.
* Please note that the order of loading is important.
*/
2014-11-10 23:12:33 +02:00
// Initialize mongoose
mongoose.connect(function (db) {
// Initialize express
var app = express.init(db);
2013-05-22 17:03:50 +03:00
2014-11-10 23:12:33 +02:00
// Start the app by listening on <port>
app.listen(config.port);
2013-05-22 17:03:50 +03:00
2014-11-10 23:12:33 +02:00
// Logging initialization
2015-07-02 12:08:09 +03:00
console.log('--');
console.log(chalk.green(config.app.title));
2015-07-02 12:08:09 +03:00
console.log(chalk.green('Environment:\t\t\t' + process.env.NODE_ENV));
console.log(chalk.green('Port:\t\t\t\t' + config.port));
console.log(chalk.green('Database:\t\t\t\t' + config.db.uri));
2015-07-02 12:08:09 +03:00
if (process.env.NODE_ENV === 'secure') {
console.log(chalk.green('HTTPs:\t\t\t\ton'));
}
console.log('--');
});