Created
October 7, 2013 18:22
-
-
Save dmongeau/6872581 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CONFIG = require('./config'); | |
var mongoose = require('mongoose'), | |
express = require('express'), | |
app = express(), | |
sanitize = require('validator').sanitize, | |
server = require('http').createServer(app), | |
io = require('socket.io').listen(server, { | |
'flash policy server' : false | |
}); | |
app.configure(function() { | |
app.use(express.compress()); | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); | |
app.use(app.router); | |
}); | |
app.enable("jsonp callback"); | |
server.listen(CONFIG.port); | |
io.set('log level', 2); | |
//Configure Socket.io | |
io.configure('production', function(){ | |
io.set('log level', 1); | |
io.enable('browser client minification'); | |
io.enable('browser client gzip'); | |
}); | |
//Handle socket.io | |
io.sockets.on('connection', function (socket) { | |
//When a message is send | |
socket.on('message', function (message) { | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment