express-rdb
v0.0.2
Published
RethinkDB connection middleware
Downloads
1
Maintainers
Readme
express-rdb
Middleware that connects to RethinkDB and sets req.db
.
Install
$ npm install --save express-rdb
Usage
var r = require('rethinkdb');
var rdb = require('express-rdb');
app.get('/users/:id', rdb({ db: 'test' }), function (req, res) {
r.table('users').get(req.params.id).run(req.db).then(user => res.send(user));
});
Credits
Author: Tristan McNab