hapi-mongoose-models
v2.0.0
Published
Auto load mongoose models for Hapi.js
Downloads
4
Maintainers
Readme
hapi-mongoose-models
Auto load mongoose models for Hapi.js
Install
$ npm install hapi-mongoose-models
Usage
const Hapi = require('hapi');
const Mongoose = require('mongoose');
const server = Hapi.server({ port: 80 });
const provision = async () => {
await server.register({
plugin: require('hapi-mongoose-models'),
options: {
globPattern: './server/models/**/*.js', // Required
globOptions: { // https://github.com/isaacs/node-glob
cwd: __dirname, // Required
nosort: true // Optional, utils for mongoose descriptors
}
}
};
await server.start();
console.log('Server running at:', server.info.uri);
};
provision();
Tests
Run comand make test
or npm test
. Include 100% test coverage.
License
MIT