resourceful mongoose objects for the hapi framework
Last updated 6 years ago by v.forgione .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hapi-mongoose-resource 
SYNC missed versions from official npm registry.

not under active development

I am no longer actively developing this project. If anyone finds it useful, go ahead an fork it or email me and I'll transfer it over.


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.

Current Tags

  • 0.0.7                                ...           latest (6 years ago)

7 Versions

  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |