server.js 667 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/env node

'use strict';

/**
 * Module dependencies.
 */
var express = require('express');

/**
 * Main application entry file.
 * Please note that the order of loading is important.
 */

// Initializing system variables
16 17
var config = require('./server/config/config'),
    app = express();
18 19 20 21 22 23 24 25

// Express settings
require('./server/config/express')(app);

// Start the app by listening on <port>
var port = process.env.PORT || config.port;
app.listen(port);

26 27
console.log('Environment is = "' + config.nodeEnv + '"');
console.log('Express app started on port ' + port + ' using config\n', JSON.stringify(config, null, 4));
28 29 30

// Expose app
module.exports = app;