resourceful mongoose objects for the hapi framework

License: MIT

Language: CoffeeScript


resourceful mongoose objects for the hapi framework

  • easily create handlers for your mongoose models
  • automatically generate routes for your handlers
  • resourceful use of references for api responses



$ npm install hapi-mongoose-handler

clone into project

$ cd /path/to/your/vendor/sources/
$ git clone https://github.com/vforgione/hapi-mongoose-resource.git
$ cd hapi-mongoose-resource
$ npm install
$ coffee -o ./lib -c ./src

that last coffee compile shouldn't be necessary, but do it just in case i forget to do it before committing.


all api documentation can be found on the projects github page: http://vforgione.github.io/hapi-mongoose-resource.

issues and feature requests

open tickets on the project's issues tab: https://github.com/vforgione/hapi-mongoose-resource/issues. i'll try to get to them as soon as i can.

pull requests

if you really took the time to fork this and make some improvements, by all means send me a pull request: https://github.com/vforgione/hapi-mongoose-resource/pulls.

please test things out first before issuing a request.


the tests are written for mocha (hence the mocha.opts file). compile the coffee script, fire up mongo, and run npm test. this will invoke the Makefile, which will run the tests.


there is an examples directory in the project - it's simple but it covers things pretty well: rolling a hapi server, setting up schemas and models, creating resources, adding routes.

i also included a few sample payloads in a comment at the bottom of examples/app.coffee. however you issue them, it will give a shallow jumping-off point.

to get it going:

$ cd /path/to/resource/tests
$ coffee -c ./
$ node app.js

and take it from there.


tl;dr i missed tastypie.

i am a python developer, thoroughly. however, i am beginning to embrace node. i've done a number of api projects with python and tastypie, and it's a great combination. i wanted to emulate its ease of use and ubiquity.

i also have done some cursory test-drives with other node frameworks, but i found hapi to be the best fit for me.

given these two points, i went in search of a solid resource plugin for hapi. i was disappointed. hapi-mongoose-handler got me close to where i wanted to be, but it just wasn't the end-all-be-all. (sidebar: it is pretty damned solid and much of my handler code was inspired by hmh). i wanted something to take away the redundancy of creating router configs. i also wanted easy linking between referenced docs. i also wanted the minty-freshest hapi version to be supported.

right now, the project isn't super verbose. i will add to it in the future, i just wanted a jumping-off point.

Project Statistics

Sourcerank 3
Repository Size 227 KB
Stars 6
Forks 0
Watchers 1
Open issues 0
Dependencies 7
Contributors 1
Tags 0
Last updated
Last pushed

Top Contributors See all

Vince Forgione

Packages Referencing this Repo

resourceful mongoose objects for the hapi framework
Latest release 0.0.7 - Updated - 6 stars

Something wrong with this page? Make a suggestion

Last synced: 2016-05-28 03:55:48 UTC

Login to resync this repository