Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = require('./config')
- , express = require('express')
- , routes = require('./routes')
- , RedisStore = require('connect-redis')(express)
- , sessionStore = new RedisStore(config.redis)
- , app = express.createServer();
- app.configure(function () {
- app.use(express.static(__dirname + '/public'));
- app.use(express.cookieParser('keyboard cat'));
- app.use(express.session({
- secret: config.sessionSecret,
- key: 'express.sid',
- store: sessionStore
- }));
- app.use(express.bodyParser());
- app.use(express.methodOverride());
- app.use(app.router);
- })
- app.configure('development', function () {
- app.use(express.errorHandler());
- });
- app.enable('jsonp callback');
- routes.init(app);
- app.listen(config.port);
- console.log("listening on port " + config.port);
- // socket.io
- var io = require('socket.io').listen(app);
- io.configure(function() {
- io.set("polling duration", 10);
- io.enable('browser client minification');
- io.enable('browser client etag');
- io.enable('browser client gzip');
- io.set('log level', 3);
- io.set('transports', ['xhr-polling']);
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment