hapi-rethinkdb-init
v0.1.0
Published
A micro plugin that use rethinkdb-init to create databases, tables and indexes when your hapi server starts.
Downloads
4
Readme
hapi-rethinkdb-init
A micro plugin that use rethinkdb-init to create databases, tables and indexes when your hapi server starts.
Install
npm install --save hapi-rethinkdb-init
Use
var Hapi = require('hapi');
var server = new Hapi.Server();
var options = {
tables: [
{
name: 'person',
indexes: ['firstName', 'lastName']
},
'address'
]
};
server.register(require('hapi-rethinkdb'), function (err) {
server.register({register: require('hapi-rethinkdb-init'), options: options}, function (err) {
// Table person with firstName and lastName indexes created
// Table address created
});
});
Options
tables
- the array of tables expected byrethinkdb-init
. Please refer to the rethinkdb-init documentation.
Dependencies
Package | Version | Dev --- |:---:|:---: joi | ^7.0.0 | ✖ rethinkdb | ^2.2.0 | ✖ rethinkdb-init | 0.0.5 | ✖ babel-cli | ^6.2.0 | ✔ babel-core | ^6.2.1 | ✔ babel-preset-es2015 | ^6.1.18 | ✔ code | ^2.0.1 | ✔ hapi | ^11.1.1 | ✔ hapi-rethinkdb | ^2.0.1 | ✔ lab | ^7.3.0 | ✔ node-readme | ^0.1.9 | ✔ rethinkdb | ^2.2.0 | ✔
Author
g-div
License
- MIT : http://opensource.org/licenses/MIT