1var express = require('express');
2var app = module.exports = express();
3
4var server = require('http').createServer(app);
5
6// Hook Socket.io into Express
7var io = require('socket.io').listen(server);
8
9// Socket.io Communication
10
11var socket = require('./scripts/socket.js');
12io.sockets.on('connection', socket);
13
14// Start server at http://127.0.0.1:3000
15
16server.listen(3000, function() {
17console.log("Express server listening on port %d in %s mode", this.address().port, app.settings.env);
18});