Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including rest-hapi with all npm packages installed. Try it out:

var restHapi = require("rest-hapi")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

rest-hapi v2.0.1

A RESTful API generator for hapi

rest-hapi logo

rest-hapi title

A RESTful API generator rest-hapi tweet

rest-hapi is a hapi plugin that generates RESTful API endpoints based on mongoose schemas. It provides a powerful combination of relational structure with NoSQL flexibility. You define your data models and the rest is done for you. Have your API up and running in minutes!


Live demo


View the swagger docs for the live demo:

Or, for a more complete example, check out the appy api:


Check out the docs on the official site!


You need Node.js installed and you'll need MongoDB installed and running.

Quick Start


(NOTE: For an alternative quick start, check out his awesome yeoman generator for rest-hapi.)

  1. Clone the demo repo
$ git clone
$ cd rest-hapi-demo
  1. Install the dependencies
$ npm install
  1. Seed the models
$ ./node_modules/.bin/rest-hapi-cli seed
  1. Start the server
$ npm start
  1. View the API docs at


...have fun!

Example Projects

appy: A boilerplate web app.

rest-hapi-demo: A simple demo project implementing rest-hapi in a hapi server.


We welcome contributions to rest-hapi! These are the many ways you can help:

Please read our contribution guide to get started. Also note that this project is released with a Contributor Code of Conduct, please make sure to review and follow it.


Thanks goes to each one of our contributors! 🙏

Become a contributor.


Support us with a monthly donation and help us continue our activities! Become a backer.


If you have any questions/issues/feature requests, please feel free to open an issue. We'd love to hear from you!


Like this project? Please star it!


rest-hapi is licensed under a MIT License.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free