How to use the MemoryStore function from express-session
Find comprehensive JavaScript express-session.MemoryStore code examples handpicked from public code repositorys.
GitHub: hexparrot/mineos-node
13 14 15 16 17 18 19 20 21 22
var expressSession = require('express-session'); var bodyParser = require('body-parser'); var methodOverride = require('method-override'); var cookieParser = require('cookie-parser'); var sessionStore = new expressSession.MemoryStore(); var app = express(); var http = require('http').Server(app); var response_options = {root: __dirname};
145
280
29
+ 3 other calls in file
24 25 26 27 28 29 30 31 32
} const appId = requireOption('appId'); const appSecret = requireOption('appSecret'); const loginPath = requireOption('loginPath'); store = options.store || new MemoryStore(); if (typeof store.set !== 'function' || typeof store.get !== 'function') { throw new Error('wafer-node-session 初始化失败:不是合法的 store'); }
13
81
34
13 14 15 16 17 18 19 20 21 22
export function buildKeycloakApolloConfig(app: Express, apolloConfig: any) { const graphqlPath = `/graphql`; console.log("Using keycloak configuration") const memoryStore = new session.MemoryStore() app.use(session({ secret: process.env.SESSION_SECRET_STRING || 'this should be a long secret', resave: false, saveUninitialized: true,
5
45
12
GitHub: zkiiito/SURF
-3 -2 -1
const session = require('express-session'); module.exports = new session.MemoryStore();
1
8
4
49 50 51 52 53 54 55 56 57 58
```js const session = require('express-session'); app.use(session({ store: isDev ? new session.MemoryStore() : MongoStore.create(options) })); ``` > You can also take a look at [example](example) directory for example usage.
351
0
53
GitHub: ORESoftware/hr4R
2 3 4 5 6 7
*/ //core var expressSession = require('express-session'); module.exports = new expressSession.MemoryStore();
1
28
0
express-session.MemoryStore is the most popular function in express-session (21 examples)