Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express')
- const index = require('../routes/index.js')
- const app = express()
- const PORT = 3000
- const Session = require('express-session')
- const FileStore = require('session-file-store')(Session)
- const path = require('path')
- app.use(Session({
- store: new FileStore({
- path: path.join(__dirname, '/tmp'),
- encrypt: true
- }),
- secret: 'Super Secret !',
- resave: true,
- saveUninitialized: true,
- name : 'sessionId'
- }));
- app.use('/', index)
- app.get('/', (req, res) => {
- res.send('OK')
- })
- app.listen(PORT, () => {
- console.log('Listening on port 3000')
- })
Add Comment
Please, Sign In to add comment