Skip to content

olistic/hapi-mongoose-q

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hapi-Mongoose-Q

Mongoose-Q connector for 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

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.

About

Hapi plugin to connect to mongoDB using mongoose-q

Resources

License

Stars

Watchers

Forks

Packages

No packages published