About
yarm is a REST middleware for Express. It enables easy definition of custom resources and can serve Mongoose models easily. It is fairly minimal and designed to be customizable and extensible.
var app = require("express")();
var yarm = require("yarm");
var Post = require("models/post");
app.use("/rest", yarm());
yarm.mongoose("posts", Post)
app.listen(80);
yarm is open source and published under the terms of the MIT license.
Changelog
version 0.4.0 released on 2015-01-14
- Warning: probably incompatible with 0.3.x because of updated dependencies
- Complete move to express 4.x API
- Move to mongodb 2.x
- Move to mongoose 4.x
- Add 'unauthorized' http status, as mentioned in docs
- Add 'status()' helper to hooks 'next' callback, as mentioned in docs
version 0.3.7 released on 2014-05-05
- Enable overriding mongoose collection paths (fixes #1)
version 0.3.6 released on 2014-04-23
- Enable creating separate yarm instances
version 0.3.5 released on 2014-03-06
- Fixed not being able to POST to mongoose scalar array fields
version 0.3.4 released on 2014-03-01
- Fixed a wrong implementation of mongoose and native hooks that prevented overriding subresources
- Fixed error when requesting aggregate collections with a limit of 0
version 0.3.3 released on 2014-02-14
- Add 'postResponse' option to mongoose and native resources
- Allow using a custom request handler with cb.custom(function(req, res) { ... });
- Add readonly helper to all resources
version 0.3.2 released on 2014-01-30
- Fixed mongoose helper directly passing yarm callback to mongoose
- URL-decode wildcard-matched parameters (except for "*")
version 0.3.0 released on 2014-01-24
- Full rewrite and API change
version 0.2.0 released on 2013-08-11
- Added 'key' option to mongoose resources
- Added mongoose aggregate support
- Added custom queries to DocumentArrays
version 0.1.1 released on 2013-08-03
- Improved mongoose resource handling
- Fixed bugs with .get/.list precedence
- Added custom queries to mongoose collections
- Rewrote native resources implementation
- Added new tests
version 0.0.6 released on 2013-08-02
- Fixed a bug with readable streams
- Added tests
version 0.0.5 released on 2013-08-01
- Initial release