https://github.com/strues/koa-resession
RethinkDB Session storage for Koa 2.
https://github.com/strues/koa-resession
Last synced: about 1 year ago
JSON representation
RethinkDB Session storage for Koa 2.
- Host: GitHub
- URL: https://github.com/strues/koa-resession
- Owner: strues
- License: mit
- Created: 2016-05-15T18:22:43.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-17T21:42:34.000Z (about 10 years ago)
- Last Synced: 2025-01-30T13:44:51.045Z (over 1 year ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Koa-ReSession








RethinkDB session storage for Koa 2. Uses async/await in favor of generator functions.
## Getting Started
Install it via npm:
```shell
npm install koa-resession
```
And include in your project:
```javascript
import ReSession from 'koa-resession';
import session from 'koa-generic-session';
import rethinkdbdash from 'rethinkdbdash';
const sessionStore = new ReSession({
connection: rethinkdbdash({host: 'localhost', port: 28015, db: 'session'}),
browserSessionsMaxAge: 5000,
db: 'session',
table: 'sessions'
});
sessionStore.setup();
export default convert(session({
store: sessionStore
}));
```
`koa-resession` depends on [rethinkdbdash](https://github.com/neumino/rethinkdbdash) or the default rethinkdb node.js driver. In addition,
it is built for use with [koa-generic-session](https://github.com/koajs/generic-session). This project is based off of
[koa-generic-session-rethinkdb](https://github.com/KualiCo/koa-generic-session-rethinkdb). Unfortunately that project seems unmaintained and has a dependency on co due to its usage of generators.
Session information is made available on ctx.session.
## License
MIT
## ToDo
- Finish writing tests
- Show a better example.