Guest User

Untitled

a guest
Aug 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. const express = require('express');
  2. const app = express();
  3.  
  4. const Session = require('express-session');
  5. const FileStore = require('session-file-store')(Session);
  6. const path = require('path');
  7.  
  8. const route = require('./routes/index');
  9.  
  10. app.use(Session({
  11. store: new FileStore({
  12. path: path.join(__dirname, '/tmp'),
  13. encrypt: true
  14. }),
  15. secret: 'Super Secret !',
  16. resave: true,
  17. saveUninitialized: true,
  18. name : 'sessionId'
  19. }));
  20.  
  21. app.use('/', route);
  22.  
  23. app.listen(3000);
Add Comment
Please, Sign In to add comment