-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
47 lines (42 loc) · 1.17 KB
/
test.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
var express = require('express');
var app = express();
var server = require('http').Server(app);
var io = require('socket.io')(server);
var RedisStore = require('connect-redis')(express);
var swig = require('swig'),
_ = require('underscore');
var users = [];
swig.setDefaults({
cache : false
});
// View engine
app.engine('html', swig.renderFile );
app.set('view engine', 'html');
app.set('views', './app/views');
var sessionStore = new RedisStore({});
// Add post, cookie and session support
app.configure(function(){
app.use( express.static('./public') );
app.use( express.logger() );
app.use( express.cookieParser() );
app.use( express.bodyParser() );
app.use( express.session({
secret : "lolcatz",
store : sessionStore
// store : new RedisStore({
// host : conf.redis.host,
// port : conf.redis.port,
// user : conf.redis.user,
// pass : conf.redis.pass
// });
}) );
/*app.use(passport.initialize());
app.use(passport.session());*/
});
app.get('/', function (req,res){
res.sendFile('index.json');
});
var homeController = require('./app/controllers/home');
homeController(io, users,sessionStore);
server.listen(80);
console.log("I'm has listening my master!");