ensl_gathers/index.js

29 lines
632 B
JavaScript
Raw Normal View History

2015-07-20 09:41:58 +00:00
"use strict";
var fs = require("fs");
var path = require("path");
var express = require("express");
var app = express();
2015-07-20 09:41:58 +00:00
var server = require('http').Server(app);
var io = require('socket.io')(server);
var config = require(path.join(__dirname, "config/config.js"));
2015-07-20 09:41:58 +00:00
// Configure express
require(path.join(__dirname, "config/express"))(app);
// Add routes
require(path.join(__dirname, "config/routes"))(app);
// Configure socket.io server
server.listen(config.port);
2015-07-20 09:41:58 +00:00
require(path.join(__dirname, "config/socketio"))(io);
console.log("Listening on port", config.port);
module.exports = {
app: app,
server: server,
io: io
};