forked from lsatkins/boxBuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
42 lines (34 loc) · 1.1 KB
/
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
const express = require('express');
const app = express();
const cookieSession = require('cookie-session');
const passport = require('passport');
require('./auth/passport-config')(passport)
const cloudinary = require('cloudinary').v2;
require('dotenv').config();
const port = 3000;
app.use(express.static('public'));
app.set('view engine', 'ejs');
app.use(express.urlencoded({extended: false}))
app.use(express.json())
app.use(cookieSession({
name: 'session',
keys: ['gq;neoisandgwe23gin'],
maxAge: null
}))
app.use(passport.initialize());
app.use(passport.session())
//routes
app.use(require('./routes/index.js'))
app.use(require('./routes/profile.js'))
app.use(require('./routes/newpost.js'))
app.use(require('./routes/login.js'))
app.use(require('./routes/registration.js'))
app.use(require('./routes/exercises.js'))
app.use(require('./routes/friends.js'))
app.use(require('./routes/notifications.js'))
app.use(require('./routes/comments.js'))
app.use(require('./routes/likes.js'))
app.use(require('./routes/personalRecords.js'))
app.listen(port, () => {
console.log(`listening on port ${port}`);
})