1.0.3 • Published 4 years ago
fastify-rethinkdb v1.0.3
fastify-rethinkdb
Simple plugin to work with RethinkDB within Fastify. Supports all features from rethinkdb-ts.
Install
npm i fastify-rethinkdb
Usage
const fastify = require('fastify')();
fastify.register(require('fastify-rethinkdb'), { host: '127.0.0.1', port: 28015, db: 'name' });
fastify.get('/', async function (req, res) {
let data = await fastify.r.db('name').table('name').get();
return res.send(data);
});
fastify.listen(3000, (err) => {
if (err) throw err;
console.log(`server listening on ${fastify.server.address().port}`);
});
License
Licensed under MIT.