-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
26 lines (22 loc) · 698 Bytes
/
Copy pathapp.js
File metadata and controls
26 lines (22 loc) · 698 Bytes
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
const express = require('express');
const cookieSession = require('cookie-session');
const router = express.Router();
const toController = require('./controllers/toDoController.js');
const bodyParser = require('body-parser');
const urlencodedParser = bodyParser.urlencoded({ extended: false });
const port = 3000;
const app = express();
app.use(
cookieSession(
{
cookieName: 'session',
secret: 'todotopsecret',
httpOnly: true,
ephemeral: true,
duration: 30 * 60 * 1000,
activeDuration: 5 * 60 * 1000
}
)
)
const routes = require('./routes')(app,urlencodedParser);
app.listen(port, () => console.log(`Example app listening on port ${port}!`))