forked from dwilhelm89/Ethermap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
43 lines (28 loc) · 1003 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'use strict';
var express = require('express');
//Catch all errors so that the node app won't crash
process.on('uncaughtException', function (err) {
console.error(err);
console.log('Node NOT Exiting...');
});
/**
* Main application file
*/
// Set default node environment to development
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
// Application Config
var config = require('./lib/config/config');
var app = express();
// Express settings
require('./lib/config/express')(app);
// Routing
require('./lib/routes')(app);
//WebSocket Starts the
var websocketServer = require('./lib/socketio')(app);
websocketServer.listen(config.port);
console.log('Express server listening on port %d in %s mode', config.port, app.get('env'));
//error logging with raven
var raven = require('raven');
app.error(raven.middleware.express('http://0a205057c4cd4538a86d394a46887736:[email protected]/3'));
// Expose app
exports = module.exports = app;