Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olistic/hapi-mongoose-q
Hapi plugin to connect to mongoDB using mongoose-q
https://github.com/olistic/hapi-mongoose-q
Last synced: 10 days ago
JSON representation
Hapi plugin to connect to mongoDB using mongoose-q
- Host: GitHub
- URL: https://github.com/olistic/hapi-mongoose-q
- Owner: olistic
- License: mit
- Created: 2015-03-22T18:20:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-22T22:06:42.000Z (over 9 years ago)
- Last Synced: 2024-10-11T05:43:24.689Z (about 1 month ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hapi-Mongoose-Q
[**Mongoose-Q**](https://github.com/iolo/mongoose-q) connector for [**hapi**](https://github.com/hapijs/hapi)
## Description
This plugin provides the functionality to **connect and disconnect from a mongoDB database** using mongoose-q. It also **ensures that the connection is available** before calling `server.start()`.
## Usage
```javascript
var Hapi = require('hapi');
var server = new Hapi.Server();server.connection({ port: 3000 });
server.register({
register: require('hapi-mongoose-q'),
options: {
mongoDbUri: 'mongodb://localhost'
}
}, function(err) {
if (err) {
console.error(err);
throw err;
}
});server.start();
```## Options
The following option must be passed when registering the plugin:
- _'mongoDbUri'_ - a string representing the connection URI used to connect to a MongoDB database server.