forked from TyIsI/deletron3030
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
35 lines (27 loc) · 898 Bytes
/
server.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
'use strict';
let express = require('express'),
app = express(),
port = process.env.PORT || 3000,
morgan = require('morgan'),
passport = require('passport'),
bodyParser = require('body-parser'),
session = require('express-session'),
SlackStrategy = require('passport-slack').Strategy;
if (app.get('env') === 'development') {
require('dotenv').config();
}
require('./config/passport')(passport);
app.set('view engine', 'jade');
app.use(morgan('dev'));
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(express.static(__dirname + '/public'));
app.listen(port, () => console.log(`listening on Port ${port}`));
app.use(session({
secret: process.env.SECRET || process.env.SECRET_DEV,
resave: false,
saveUninitialized: false
}));
app.use(passport.initialize());
app.use(passport.session());
require('./config/routes')(app, passport);