1import connectRedis from 'connect-redis';
2import session from 'express-session';
3const RedisStore = connectRedis(session);
4
5 app.use(
6 session({
7 secret: 'secret',
8 store: new RedisStore({host: '127.0.0.1', port: 6379}),
9 resave: false,
10 saveUninitialized: false
11 })
12 );
1import * as session from 'express-session';
2import * as RedisStore from 'connect-redis';
3
4app.use(session({
5 store: new (RedisStore(session))(options),...
6}));
7
1import * as session from 'express-session';
2import * as connectRedis from 'connect-redis';
3let RedisStore = connectRedis(session);
4
5app.use(session({
6 store: new RedisStore({client: redis.createClient(6379, "localhost")}),...
7}));