Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aljones15/express-sql-session-promise-adapter
Beginning an Adapter for msql2 promises to be used with express-session Store
https://github.com/aljones15/express-sql-session-promise-adapter
express express-session mysql2
Last synced: 8 days ago
JSON representation
Beginning an Adapter for msql2 promises to be used with express-session Store
- Host: GitHub
- URL: https://github.com/aljones15/express-sql-session-promise-adapter
- Owner: aljones15
- Created: 2017-11-12T12:59:41.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-26T13:24:45.000Z (over 6 years ago)
- Last Synced: 2023-11-07T18:01:07.637Z (about 1 year ago)
- Topics: express, express-session, mysql2
- Language: JavaScript
- Size: 43 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
}
};
```