This commit is contained in:
Chris Blanchard 2016-01-22 11:22:40 +00:00
parent 3a55e1c572
commit edb92c2474

View file

@ -1,18 +1,15 @@
"use strict"; "use strict";
var env = process.env.NODE_ENV || "development"; const env = process.env.NODE_ENV || "development";
const fs = require("fs");
const path = require("path");
const express = require("express");
const app = express();
const server = require('http').Server(app);
const io = require('socket.io')(server);
const config = require(path.join(__dirname, "config/config.js"));
if (env === "production") { if (env === "production") require("newrelic");
require("newrelic");
}
var fs = require("fs");
var path = require("path");
var express = require("express");
var app = express();
var server = require('http').Server(app);
var io = require('socket.io')(server);
var config = require(path.join(__dirname, "config/config.js"));
// Load Models // Load Models
require(path.join(__dirname, "db/index")); require(path.join(__dirname, "db/index"));
@ -28,16 +25,14 @@ require(path.join(__dirname, "config/express"))(app);
// Add routes // Add routes
require(path.join(__dirname, "config/routes"))(app); require(path.join(__dirname, "config/routes"))(app);
// Configure socket.io server
require(path.join(__dirname, "config/socketio"))(io); require(path.join(__dirname, "config/socketio"))(io);
// Configure socket.io server
server.listen(config.port); server.listen(config.port);
console.log("Listening on port", config.port); console.log("Listening on port", config.port);
module.exports = { module.exports = {
app: app, app: app,
server: server, server: server,
io: io io: io
}; };