2015-02-06 16:46:55 +01:00
|
|
|
/**
|
|
|
|
* Main application file
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Set default node environment to development
|
|
|
|
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
|
|
|
|
|
|
|
var express = require('express');
|
|
|
|
var config = require('./config/environment');
|
|
|
|
|
|
|
|
|
|
|
|
// Setup server
|
|
|
|
var app = express();
|
|
|
|
var server = require('http').createServer(app);
|
|
|
|
require('./config/express')(app);
|
|
|
|
require('./routes')(app);
|
|
|
|
|
|
|
|
// Start server
|
|
|
|
server.listen(config.port, config.ip, function () {
|
|
|
|
console.log('Express server listening on %d, in %s mode', config.port, app.get('env'));
|
|
|
|
});
|
|
|
|
|
|
|
|
// Expose app
|
2015-04-18 01:53:16 +02:00
|
|
|
exports = module.exports = app;
|