express-mysql2-session-promise-adapter
Lets you use MySQL2 promises with expression-SQL-session storage
Last updated a year ago by liminal18 .
ISC · Original npm · Tarball · package.json
$ cnpm install express-mysql2-session-promise-adapter 
SYNC missed versions from official npm registry.

express-sql-session-promise-adapter

note: this is no longer necessary sql session now supports promises

default: promiseAdapter let's you use mysql2 promises with express-mysql-session

import promiseAdapter from 'express-session-mysql2-promise-adapter';
import express from 'express';
import session from 'express-session';
import SQLSession from 'express-mysql-session';
import mysqlPromise from 'mysql2/promise';


export let db = mysqlPromise.createConnection({
  host: '127.0.0.1',
  port: 3306,
  user: process.env.SESSION_DB_USER,
  password: process.env.SESSION_DB_PASSWORD,
  database: process.env.SESSION_DB,
  connectTimeout: 600
});

const port = 8085;
const SQLStore = SQLSession(session);
const sessionStore = new SQLStore({}, promiseAdapter(db));
const localSession = {
  store: sessionStore,
  secret: 'test_secret',
  resave: true,
  rolling: true,
  saveUninitialized: true,
  cookie: {
    maxAge: 99999,
    httpOnly: false
  }
};

Current Tags

  • 1.0.3                                ...           latest (a year ago)

4 Versions

  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 2
Dependencies (4)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |