mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-26 06:10:58 +00:00
Clean up
This commit is contained in:
parent
3a55e1c572
commit
edb92c2474
1 changed files with 11 additions and 16 deletions
27
index.js
27
index.js
|
@ -1,18 +1,15 @@
|
|||
"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") {
|
||||
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"));
|
||||
if (env === "production") require("newrelic");
|
||||
|
||||
// Load Models
|
||||
require(path.join(__dirname, "db/index"));
|
||||
|
@ -28,16 +25,14 @@ require(path.join(__dirname, "config/express"))(app);
|
|||
// Add routes
|
||||
require(path.join(__dirname, "config/routes"))(app);
|
||||
|
||||
// Configure socket.io server
|
||||
require(path.join(__dirname, "config/socketio"))(io);
|
||||
|
||||
// Configure socket.io server
|
||||
|
||||
server.listen(config.port);
|
||||
|
||||
console.log("Listening on port", config.port);
|
||||
|
||||
module.exports = {
|
||||
app: app,
|
||||
server: server,
|
||||
io: io
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue