Restberry works with both Express and Restify!
Framework for setting up RESTful JSON APIs with NodeJS. Define your models and setup CRUD API calls without needing to write any code (see Usage). All API calls will handle and identify issues and throw necessary HTTP responses and easy to debug error responses. Restberry also handles authentication and permission checks and throws appropriate errors.
npm install restberry
example for a detailed documentation of how you setup a Restberry app.
var restberry = ;restberry;restberryroutes;restberryroutes;
NOTE: By default, Restberry integrates with ExpressJS and Mongoose but it can be hooked up with other packages. See more usages in the tests and dependent packages like:
All these responses below are automatically handled without needing to write any additional code.
- 200 OK
- 201 CREATED
- 204 NO CONTENT
restberry-errors for possible error responses.
restberryroutes// POST /foos// DELETE /foos/:id// POST /foos/:id// GET /foos// GET /foos/:id// PUT /foos/:id// All of the above...
Handle action query strings like this:
And Handle parent models like this:
restberryroutes// POST /bars/:id/foos
NOTE: this can only be applied to ReadMany and Create.
You can also create custom routes. The possible configurations you can make are:
NOTE: you can set these properties to all the predefined API definitions,
you won't be able to override
Run the tests
I'm really interested to here what you guys think of Restberry, especially if you have any suggestions to improve the package. Please contact me at firstname.lastname@example.org.