@aptoma/hapi-mongoose-helper

5.0.1 • Public • Published

Hapi Mongoose Helper

Utility functions for using mongoose with hapi.

Installation

This module is installed via npm:

$ npm install @aptoma/hapi-mongoose-helper

Example

const mongooseHelper = require('@aptoma/hapi-mongoose-helper');
const mongoose = require('mongoose');
const server = new Hapi.Server();
server.connection();

mongooseHelper
	.connect(mongoose, server, config.database)
	.then(() => server.start())
	.then(() => {
		server.log('info', pkgInfo.name + ' v' + pkgInfo.version + ' started at: ' + server.info.uri);
	})
	.catch((err) => {
		console.error('Error starting server', err);
		process.exit(1);
	});

Readme

Keywords

none

Package Sidebar

Install

npm i @aptoma/hapi-mongoose-helper

Weekly Downloads

14

Version

5.0.1

License

MIT

Unpacked Size

13.8 kB

Total Files

8

Last publish

Collaborators

  • aptoma