mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-29 23:52:50 +00:00
Clean up
This commit is contained in:
parent
3a55e1c572
commit
edb92c2474
1 changed files with 11 additions and 16 deletions
25
index.js
25
index.js
|
@ -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,12 +25,10 @@ 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 = {
|
||||||
|
|
Loading…
Reference in a new issue