-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
30 lines (25 loc) · 876 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
var express = require('express'),
path = require('path'),
partials = require('express-partials'),
bodyParser = require('body-parser'),
routes = require('./routes/index'),
flash = require('connect-flash'),
cookieParser = require('cookie-parser'),
session = require('express-session');
var app = express();
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(cookieParser());
app.use(session({secret: 'cdquery',
resave: true,
saveUninitialized: true
}));
app.use(flash());
app.use(partials());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'public')));
routes(app);
app.listen(3000, function(){
console.log('please open http://localhost:3000, app is listening at port 3000');
});