@pager/hapi-mongo
v7.0.2
Published
A hapi MongoDB plugin
Downloads
1,550
Maintainers
Readme
Hapi-mongo
A hapi Mongoose plugin
This plugin provides a MongoDB connection for your Hapi.js server. The configuration settings take the following options:
url
- (option) database connection uri, following MongoDB's specs. Defaults to MONGO_URL environment variablesettings
- (optional) database connection options, as described here.
const plugin = {
register: require('@pager/hapi-mongo'),
options: { url: 'mongodb://localhost/test' }
};
await server.register(plugin); // throws if no connection is possible
// server.app.mongo is exposed