-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
50 lines (42 loc) · 1.17 KB
/
index.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
var express = require('express');
var app = express();
var http = require('http').Server(app);
var session = require('express-session');
var cookieParser = require('cookie-parser');
var colors = require('colors');
var log = require('./middleware/generic/log');
var logger = require('./middleware/generic/logger');
var bodyParser = require('body-parser');
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.use(bodyParser());
app.use( bodyParser.json() );
app.use(cookieParser());
app.use(session({
secret: "none",
user: {
name : "anonim"
},
cookie: {
maxAge: 600000
},
resave: true,
saveUninitialized: false,
}));
app.use(log(logger()));
require('./routes/out')(app);
require('./routes/task')(app,logger());
require('./routes/user')(app,logger());
require('./routes/project')(app,logger());
require('./routes/chat')(io);
app.use(express.static(__dirname));
app.set('view engine', 'ejs');
app.use(function (err, req, res, next) {
console.log(colors.red(err));
res.status(500).send();
//Flush out the stack to the console
console.error(err.stack);
});
http.listen(3000, function(){
console.log(colors.green('listening on *:3000'));
});