Created
June 7, 2019 06:09
-
-
Save phongkt-dev/21173963e77fa0e2e937706984f83cf2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express') | |
| var parseurl = require('parseurl') | |
| var session = require('express-session') | |
| var app = express() | |
| const mongoose = require('mongoose'); | |
| // Basic usage | |
| mongoose.connect(connectionOptions); | |
| app.use(session({ | |
| secret: 'keyboard cat', | |
| resave: false, | |
| saveUninitialized: true, | |
| store: new MongoStore({ mongooseConnection: mongoose.connection }) | |
| })); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment