Skip to content

Commit

Permalink
Added details to README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pete Thomas committed Jun 10, 2011
1 parent 4a0713e commit 4a093ec
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,40 @@

##Overview

ORM for node. See usage
An ORM for node with these features:

* Migrations
* Associations
* Connection pooling
* Support for multiple databases
* A plugin api, e.g., from examples/plugins/ExpressPlugin.js

var moose = require("../../lib"), comb = require("comb");

```javascript
/*
* Very simple express routing for a model
* */
module.exports = exports = comb.define(null, {
static : {
route : function(app){
app.get("/" + this.tableName + "/:id", comb.hitch(this, function(req, res){
var id = req.params.id;
this.findById(id).then(function(model){
var response;
if(model){
response = model.toObject();
}else{
response = {error : "Could not find a model with id " + id};
}
res.send(response);
});
}));
}
}
});
```

## Installation

npm install moose
Expand Down Expand Up @@ -33,4 +65,4 @@ MIT <https://github.com/Pollenware/moose/raw/master/LICENSE>

* Code: `git clone git://github.com/pollenware/moose.git`
* JsDoc: <http://pollenware.github.com/moose>
* Website: <http://pollenware.com> - Twitter: <http://twitter.com/pollenware> - 877.465.4045
* Website: <http://pollenware.com> - Twitter: <http://twitter.com/pollenware> - 877.465.4045

0 comments on commit 4a093ec

Please sign in to comment.