-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.js
44 lines (38 loc) · 1.37 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
43
44
const express = require('express')
session = require('express-session'),
FileStore = require('session-file-store')(session),
es6Renderer = require('express-es6-template-engine'),
path = require('path'),
cookieParser = require('cookie-parser'),
logger = require('morgan');
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const projectsRouter = require('./routes/projects');
const myProjectsRouter = require('./routes/myprojects');
const myProfileRouter = require('./routes/myprofile');
const matchMakerRouter = require('./routes/matchmaker');
const myMatchesRouter = require('./routes/mymatches');
const app = express();
app.engine('html', es6Renderer);
app.set('views', 'views');
app.set('view engine', 'html');
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(session({
store: new FileStore(),
secret: 'get rad',
resave: false,
saveUninitialized: true,
is_logged_in: false
}));
app.use('/', indexRouter);
app.use('/users', usersRouter);
app.use('/projects', projectsRouter);
app.use('/myprojects', myProjectsRouter);
app.use('/myprofile', myProfileRouter);
app.use('/matchmaker', matchMakerRouter);
app.use('/mymatches', myMatchesRouter);
module.exports = app;