Skip to content

bulaluis/hapi-mongoose-connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hapi-mongoose-connect

Mongoose connection for hapi.js

Install

$ npm install hapi-mongoose-connect

Usage

var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 8000 });

server.register({
		register: require('hapi-mongoose-connect'),
		options: {
			mongooseUri: 'mongodb://localhost/my-database',
			mongooseOptions: {}		// http://mongoosejs.com/docs/connections.html
		}
	}, function (err) {

    	if (err) {
    		throw err;
    	}

    	server.start(function (err) {

    	    if (err) {
    	        throw err;
    	    }
    	    console.log('Server started at: ' + server.info.uri);
    	});
    }
});

Tests

Run comand make test or npm test. Include 100% test coverage.

License

MIT