crud-middleware

0.0.4 • Public • Published

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)

Dependencies (5)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i crud-middleware

    Weekly Downloads

    1

    Version

    0.0.4

    License

    ISC

    Last publish

    Collaborators

    • sawbones