0.0.4 • Published 9 years ago

crud-middleware v0.0.4

Weekly downloads
4
License
ISC
Repository
github
Last release
9 years ago

#CRUD

CRUD is a connect-middleware for Express that takes the tediousness out of building prototype RESTful CRUD urls. CRUD uses mongodb. Future releases will support mysql and postgres.

var crud = require('crud');

var models = {};

models.posts = {
    title: String,
    body: String,
    publishedDate: { default: _.now(), type: Date },
    userId: Number
};

models.users = {
    email: String,
    password: String
};

app.use('/api', crud(models));

The object returned from crud() is an express.Router, therefore you can attach any extra middleware if needed

TODO

  • JSON Web Tokens for Auth and Scopes
  • Support for Mysql and Postgres
  • Database session storage (login)