-
Notifications
You must be signed in to change notification settings - Fork 6
/
app.js
54 lines (35 loc) · 992 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* Module dependencies.
*/
var express = require('express');
var app = module.exports = express.createServer();
// ln -s '../common' ./lib/client/common
var bundle = require('browserify')({
entry:__dirname + '/lib/client/index.js',
watch:true
});
// Server Configuration
app.configure(function(){
app.use(express.bodyParser());
app.use(express.methodOverride());
//static files
app.use(express.static(__dirname + '/public'));
app.use(express.static(__dirname + '/public/js'));
app.use(bundle);
// Session support
app.use(express.cookieParser());
var RedisStore = require('connect-redis')(express);
store = new RedisStore();
app.use(express.session({
secret: "Rush 2112",
store: store
}));
});
// Server Routes
app.listen(3000);
console.log("Server ready: Throw 'em up!!!");
var io = require('socket.io').listen(app);
io.set('log level', 1);
io.sockets.on('connection', function (socket) {
require('./lib/controllers')(socket);
});