Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mglagola/hapi-mongoose-connection
Simple mongoose plugin for hapi
https://github.com/mglagola/hapi-mongoose-connection
hapi middleware mongodb mongoose nodejs plugin
Last synced: 7 days ago
JSON representation
Simple mongoose plugin for hapi
- Host: GitHub
- URL: https://github.com/mglagola/hapi-mongoose-connection
- Owner: mglagola
- Created: 2017-03-19T19:12:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-12T03:48:37.000Z (over 6 years ago)
- Last Synced: 2024-10-05T16:41:35.688Z (3 months ago)
- Topics: hapi, middleware, mongodb, mongoose, nodejs, plugin
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hapi Mongoose Connection Plugin
## Install
**NPM**
```bash
$ npm install hapi-mongoose-connection --save
```## Usage
```js
const HapiMongoose = require('hapi-mongoose-connection');
const Promise = require('bluebird');const mongodbURI = process.env.MONGODB_URI;
const MongooseSetup = {
register: HapiMongoose,
options: {
uri: mongodbURI,
promise: Promise,
...any_mongoose_connection_options_here
},
};...
server.register([
...
MongooseSetup,
...
], (err) => {
if (err) throw err;
...
});```
## License
MIT